Skip to content

Commit 5f9ab5f

Browse files
authored
Merge pull request ekristen#505 from ekristen/fix-cloud-control
fix: cloud control resources
2 parents 553175e + 6902c1f commit 5f9ab5f

File tree

357 files changed

+258
-4350
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

357 files changed

+258
-4350
lines changed

docs/config-cloud-control.md

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,85 @@
11
# Config - Cloud Control
22

3-
Coming Soon
3+
aws-nuke supports removing resources via the AWS Cloud Control API.
4+
5+
There are number of Cloud Control resources that are automatically registered as resources that can be removed by
6+
aws-nuke. Additionally, there are a number of resources implemented in aws-nuke that have a Cloud Control equivalent,
7+
this is called an **alternative resource**.
8+
9+
For the subset of Cloud Control supported resources that are registered with aws-nuke they work like any other resource,
10+
but they are registered with their Cloud Control API name (i.e. `AWS::Bedrock::Agent`).
11+
12+
However, there are resources that have already been implemented in aws-nuke that have a Cloud Control equivalent. For
13+
these resources an **alternative resource** has been defined. They are **MUTUALLY EXCLUSIVE**, if you include the Cloud
14+
Control resource in your config file, the native resource will be disabled.
15+
16+
Furthermore, there are some Cloud Control resources that need special handling which are not yet supported by aws-nuke.
17+
18+
Finally, even though the subset of automatically supported Cloud Control resources is limited, you can configure
19+
aws-nuke to make it try any additional resource. Either via command line flags of via the config file.
20+
21+
## Why Use Cloud Control Resources
22+
23+
The Cloud Control API is a standardized API that potentially allows you to nuke any resource regardless if it is defined
24+
within aws-nuke or not. This is especially useful for new resources that are not yet supported by aws-nuke.
25+
26+
## Impact on Filters
27+
28+
Because of how Cloud Control API resources work vs native implemented resources in aws-nuke, not all properties are
29+
available for filtering. For example, the `AWS::EC2::VPC` resource has a `VpcId` only, whereas the `EC2VPC` resource has
30+
`VpcID`, `Tags`, `OwnerID` and more.
31+
32+
## Configuration
33+
34+
For the config file you have to add the resource to the `resource-types.alternatives` list:
35+
36+
!!! note
37+
If you are migrating from aws-nuke@v2 `cloud-control` is deprecated but still supported for backwards compatibility
38+
in the configuration file. The new key is `resource-types.alternatives`.
39+
40+
```yaml
41+
resource-types:
42+
alternatives:
43+
- `AWS::EC2::TransitGateway
44+
- `AWS::EC2::VPC
45+
```
46+
47+
If you want to use the command line, you have to add a `--cloud-control` flag for each resource you want to add:
48+
49+
!!! important
50+
This will not limit the resources to only these two resources, but will add them to the list of resources that are
51+
automatically removed via Cloud Control.
52+
53+
```console
54+
aws-nuke run \
55+
-c nuke-config.yaml \
56+
--cloud-control `AWS::EC2::TransitGateway \
57+
--cloud-control `AWS::EC2::VPC
58+
```
59+
60+
## Supported Resources
61+
62+
These are the resources that are automatically supported by aws-nuke directly as Cloud Control resources that are
63+
automatically scanned.
64+
65+
- `AWS::AppFlow::ConnectorProfile`
66+
- `AWS::AppFlow::Flow`
67+
- `AWS::AppRunner::Service`
68+
- `AWS::ApplicationInsights::Application`
69+
- `AWS::Backup::Framework`
70+
- `AWS::ECR::PullThroughCacheRule`
71+
- `AWS::ECR::RegistryPolicy`
72+
- `AWS::ECR::ReplicationConfiguration`
73+
- `AWS::MWAA::Environment`
74+
- `AWS::Synthetics::Canary`
75+
- `AWS::Timestream::Database`
76+
- `AWS::Timestream::ScheduledQuery`
77+
- `AWS::Timestream::Table`
78+
- `AWS::Transfer::Workflow`
79+
- `AWS::NetworkFirewall::Firewall`
80+
- `AWS::NetworkFirewall::FirewallPolicy`
81+
- `AWS::NetworkFirewall::RuleGroup`
82+
83+
## References
84+
85+
- [Supported Resources](https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/supported-resources.html)

docs/resources/access-analyzer.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ AccessAnalyzer
1313

1414
### Alternative Resource
1515

16-
!!! note - Cloud Control API - Alternative Resource
17-
This resource can also be controlled and used via Cloud Control API. Please refer to the documentation for
18-
[Cloud Control Resources](../config-cloud-control.md) for more information.
16+
!!! warning - Cloud Control API - Alternative Resource
17+
This resource conflicts with an alternative resource that can be controlled and used via Cloud Control API. If you
18+
use this alternative resource, please note that any properties listed on this page may not be valid. You will need
19+
run the tool to determine what properties are available for the alternative resource via the Cloud Control API.
20+
Please refer to the documentation for [Cloud Control Resources](../config-cloud-control.md) for more information.
1921

2022
```text
2123
AWS::AccessAnalyzer::Analyzer

docs/resources/acmpca-certificate-authority.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ ACMPCACertificateAuthority
1313

1414
### Alternative Resource
1515

16-
!!! note - Cloud Control API - Alternative Resource
17-
This resource can also be controlled and used via Cloud Control API. Please refer to the documentation for
18-
[Cloud Control Resources](../config-cloud-control.md) for more information.
16+
!!! warning - Cloud Control API - Alternative Resource
17+
This resource conflicts with an alternative resource that can be controlled and used via Cloud Control API. If you
18+
use this alternative resource, please note that any properties listed on this page may not be valid. You will need
19+
run the tool to determine what properties are available for the alternative resource via the Cloud Control API.
20+
Please refer to the documentation for [Cloud Control Resources](../config-cloud-control.md) for more information.
1921

2022
```text
2123
AWS::ACMPCA::CertificateAuthority

docs/resources/amg-workspace.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,3 @@ AMGWorkspace
1313

1414

1515

16-
!!! note - Using Properties
17-
Properties are what [Filters](../config-filtering.md) are written against in your configuration. You use the property
18-
names to write filters for what you want to **keep** and omit from the nuke process.
19-
20-
### String Property
21-
22-
The string representation of a resource is generally the value of the Name, ID or ARN field of the resource. Not all
23-
resources support properties. To write a filter against the string representation, simply omit the `property` field in
24-
the filter.
25-
26-
The string value is always what is used in the output of the log format when a resource is identified.
27-

docs/resources/amp-workspace.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,3 @@ AMPWorkspace
1313

1414

1515

16-
!!! note - Using Properties
17-
Properties are what [Filters](../config-filtering.md) are written against in your configuration. You use the property
18-
names to write filters for what you want to **keep** and omit from the nuke process.
19-
20-
### String Property
21-
22-
The string representation of a resource is generally the value of the Name, ID or ARN field of the resource. Not all
23-
resources support properties. To write a filter against the string representation, simply omit the `property` field in
24-
the filter.
25-
26-
The string value is always what is used in the output of the log format when a resource is identified.
27-

docs/resources/api-gateway-api-key.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ APIGatewayAPIKey
1313

1414
### Alternative Resource
1515

16-
!!! note - Cloud Control API - Alternative Resource
17-
This resource can also be controlled and used via Cloud Control API. Please refer to the documentation for
18-
[Cloud Control Resources](../config-cloud-control.md) for more information.
16+
!!! warning - Cloud Control API - Alternative Resource
17+
This resource conflicts with an alternative resource that can be controlled and used via Cloud Control API. If you
18+
use this alternative resource, please note that any properties listed on this page may not be valid. You will need
19+
run the tool to determine what properties are available for the alternative resource via the Cloud Control API.
20+
Please refer to the documentation for [Cloud Control Resources](../config-cloud-control.md) for more information.
1921

2022
```text
2123
AWS::ApiGateway::ApiKey

docs/resources/api-gateway-client-certificate.md

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,14 @@ APIGatewayClientCertificate
1313

1414
### Alternative Resource
1515

16-
!!! note - Cloud Control API - Alternative Resource
17-
This resource can also be controlled and used via Cloud Control API. Please refer to the documentation for
18-
[Cloud Control Resources](../config-cloud-control.md) for more information.
16+
!!! warning - Cloud Control API - Alternative Resource
17+
This resource conflicts with an alternative resource that can be controlled and used via Cloud Control API. If you
18+
use this alternative resource, please note that any properties listed on this page may not be valid. You will need
19+
run the tool to determine what properties are available for the alternative resource via the Cloud Control API.
20+
Please refer to the documentation for [Cloud Control Resources](../config-cloud-control.md) for more information.
1921

2022
```text
2123
AWS::ApiGateway::ClientCertificate
2224
```
2325

2426

25-
!!! note - Using Properties
26-
Properties are what [Filters](../config-filtering.md) are written against in your configuration. You use the property
27-
names to write filters for what you want to **keep** and omit from the nuke process.
28-
29-
### String Property
30-
31-
The string representation of a resource is generally the value of the Name, ID or ARN field of the resource. Not all
32-
resources support properties. To write a filter against the string representation, simply omit the `property` field in
33-
the filter.
34-
35-
The string value is always what is used in the output of the log format when a resource is identified.
36-

docs/resources/api-gateway-domain-name.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,3 @@ APIGatewayDomainName
1313

1414

1515

16-
!!! note - Using Properties
17-
Properties are what [Filters](../config-filtering.md) are written against in your configuration. You use the property
18-
names to write filters for what you want to **keep** and omit from the nuke process.
19-
20-
### String Property
21-
22-
The string representation of a resource is generally the value of the Name, ID or ARN field of the resource. Not all
23-
resources support properties. To write a filter against the string representation, simply omit the `property` field in
24-
the filter.
25-
26-
The string value is always what is used in the output of the log format when a resource is identified.
27-

docs/resources/api-gateway-rest-api.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,3 @@ APIGatewayRestAPI
1313

1414

1515

16-
!!! note - Using Properties
17-
Properties are what [Filters](../config-filtering.md) are written against in your configuration. You use the property
18-
names to write filters for what you want to **keep** and omit from the nuke process.
19-
20-
### String Property
21-
22-
The string representation of a resource is generally the value of the Name, ID or ARN field of the resource. Not all
23-
resources support properties. To write a filter against the string representation, simply omit the `property` field in
24-
the filter.
25-
26-
The string value is always what is used in the output of the log format when a resource is identified.
27-

docs/resources/api-gateway-usage-plan.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ APIGatewayUsagePlan
1313

1414
### Alternative Resource
1515

16-
!!! note - Cloud Control API - Alternative Resource
17-
This resource can also be controlled and used via Cloud Control API. Please refer to the documentation for
18-
[Cloud Control Resources](../config-cloud-control.md) for more information.
16+
!!! warning - Cloud Control API - Alternative Resource
17+
This resource conflicts with an alternative resource that can be controlled and used via Cloud Control API. If you
18+
use this alternative resource, please note that any properties listed on this page may not be valid. You will need
19+
run the tool to determine what properties are available for the alternative resource via the Cloud Control API.
20+
Please refer to the documentation for [Cloud Control Resources](../config-cloud-control.md) for more information.
1921

2022
```text
2123
AWS::ApiGateway::UsagePlan

0 commit comments

Comments
 (0)