Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Adds tag filter support to resource EC2VPCEndpointServiceConfiguration #1175

Closed

Conversation

gavD
Copy link

@gavD gavD commented Jan 3, 2024

What we have done

We have a teardown use-case that needs to step over a particular EC2VPCEndpointServiceConfiguration that has the tag allow_delete set to false:

      EC2VPCEndpointServiceConfiguration:
        - property: tag:allow_delete
          value: false

So we have added this configuration to the resource.

References

  1. Similar to work done by @sjpalf here add tag support to CloudWatchLogsLogGroup #855

Evidence of work

Running the command dist/aws-nuke --config nuke-config.yml --quiet --target EC2VPCEndpointServiceConfiguration with the filter commented out from our config gives us:

eu-west-2 - EC2VPCEndpointServiceConfiguration - vpce-svc-<redacted> - [Name: com.amazonaws.vpce.eu-west-2.vpce-svc-<redacted>, tag:Name: <redacted>g, tag:allow_delete: false, tag:auth_enabled: true, tag:component: <redacted>, tag:component_root: core, tag:environment: <redacted>, tag:managed_by: terragrunt, tag:ssl_enabled: true, tag:strict_auth_enabled: true, tag:team: <redacted>] - would remove
Scan complete: 1 total, 1 nukeable, 0 filtered.

With the filter present in our config we get:

Scan complete: 1 total, 0 nukeable, 1 filtered.

This matches our expectations

Risks

I've not worked on this repo before and I'm not a regular Go-bot so my Go code might be suboptimal

What we have done
--

We have a teardown use-case that needs to step over a particular EC2VPCEndpointServiceConfiguration that has the tag allow_delete set to false:

```yaml
      EC2VPCEndpointServiceConfiguration:
        - property: tag:allow_delete
          value: false
```

So we have added this configuration to the resource.

References
--

1. Similar to work done by @sjpalf here rebuy-de#855

Evidence of work
--

Running the command dist/aws-nuke  --config nuke-config.yml --quiet --target EC2VPCEndpointServiceConfiguration with the filter commented out from our config gives us:

```
eu-west-2 - EC2VPCEndpointServiceConfiguration - vpce-svc-<redacted> - [Name: com.amazonaws.vpce.eu-west-2.vpce-svc-<redacted>, tag:Name: <redacted>g, tag:allow_delete: false, tag:auth_enabled: true, tag:component: <redacted>, tag:component_root: core, tag:environment: <redacted>, tag:managed_by: terragrunt, tag:ssl_enabled: true, tag:strict_auth_enabled: true, tag:team: <redacted>] - would remove
Scan complete: 1 total, 1 nukeable, 0 filtered.
````

With the filter present in our config we get:

```
Scan complete: 1 total, 0 nukeable, 1 filtered.
```

This matches our expectations

Risks
--

I've not worked on this repo before and I'm not a regular Go-bot so my Go code might be suboptimal
@gavD
Copy link
Author

gavD commented Feb 26, 2024

closing this PR as it looks implemented by ekristen/aws-nuke#100 :-) thanks

@gavD gavD closed this Feb 26, 2024
@gavD gavD deleted the feature/ec2-vpc-endpoint-service-tags branch February 26, 2024 15:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant