dbt-platform-helper 11.4.0__py3-none-any.whl → 12.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of dbt-platform-helper might be problematic. Click here for more details.

Files changed (32) hide show
  1. dbt_platform_helper/COMMANDS.md +3 -252
  2. dbt_platform_helper/addons-template-map.yml +7 -33
  3. dbt_platform_helper/commands/application.py +8 -7
  4. dbt_platform_helper/commands/conduit.py +1 -4
  5. dbt_platform_helper/commands/copilot.py +14 -110
  6. dbt_platform_helper/commands/environment.py +0 -5
  7. dbt_platform_helper/commands/pipeline.py +1 -13
  8. dbt_platform_helper/domain/database_copy.py +2 -2
  9. dbt_platform_helper/domain/maintenance_page.py +9 -4
  10. dbt_platform_helper/templates/addon-instructions.txt +1 -1
  11. dbt_platform_helper/templates/addons/svc/s3-policy.yml +0 -8
  12. dbt_platform_helper/utils/platform_config.py +2 -7
  13. dbt_platform_helper/utils/validation.py +3 -78
  14. {dbt_platform_helper-11.4.0.dist-info → dbt_platform_helper-12.0.1.dist-info}/METADATA +1 -1
  15. {dbt_platform_helper-11.4.0.dist-info → dbt_platform_helper-12.0.1.dist-info}/RECORD +19 -32
  16. platform_helper.py +0 -8
  17. dbt_platform_helper/commands/check_cloudformation.py +0 -87
  18. dbt_platform_helper/commands/dns.py +0 -952
  19. dbt_platform_helper/custom_resources/__init__.py +0 -0
  20. dbt_platform_helper/custom_resources/s3_object.py +0 -85
  21. dbt_platform_helper/templates/addons/env/addons.parameters.yml +0 -19
  22. dbt_platform_helper/templates/addons/env/aurora-postgres.yml +0 -604
  23. dbt_platform_helper/templates/addons/env/monitoring.yml +0 -121
  24. dbt_platform_helper/templates/addons/env/opensearch.yml +0 -257
  25. dbt_platform_helper/templates/addons/env/rds-postgres.yml +0 -603
  26. dbt_platform_helper/templates/addons/env/redis-cluster.yml +0 -171
  27. dbt_platform_helper/templates/addons/env/s3.yml +0 -219
  28. dbt_platform_helper/templates/addons/env/vpc.yml +0 -120
  29. dbt_platform_helper/utils/cloudformation.py +0 -34
  30. {dbt_platform_helper-11.4.0.dist-info → dbt_platform_helper-12.0.1.dist-info}/LICENSE +0 -0
  31. {dbt_platform_helper-11.4.0.dist-info → dbt_platform_helper-12.0.1.dist-info}/WHEEL +0 -0
  32. {dbt_platform_helper-11.4.0.dist-info → dbt_platform_helper-12.0.1.dist-info}/entry_points.txt +0 -0
@@ -1,171 +0,0 @@
1
- # {% extra_header %}
2
- # {% version_info %}
3
-
4
- Parameters:
5
- # Copilot required Parameters...
6
- App:
7
- Type: String
8
- Description: Your application's name.
9
- Env:
10
- Type: String
11
- Description: The environment name your service, job, or workflow is being deployed to.
12
-
13
- # Parameters from the parent stack brought in via addons.parameters.yml...
14
- EnvironmentSecurityGroup:
15
- Type: String
16
- PrivateSubnets:
17
- Type: String
18
- VpcId:
19
- Type: String
20
-
21
- Mappings:
22
- {{ addon_config.prefix }}EnvironmentConfigMap:
23
- {%- for env_name, config in addon_config.environments.items() %}
24
- {{ env_name }}:
25
- EngineVersion: '{{ config.engine }}'
26
- CacheNodeType: '{{ config.instance }}'
27
- NumReplicas: {{ config.replicas }}
28
- DeletionPolicy: {{ config.deletion_policy }}
29
- {%- endfor %}
30
-
31
- {{ addon_config.prefix }}EngineVersionMap:
32
- '7.1':
33
- CacheParameterGroupFamily: 'redis7.x'
34
- '7.0':
35
- CacheParameterGroupFamily: 'redis7.x'
36
- '6.2':
37
- CacheParameterGroupFamily: 'redis6.x'
38
-
39
- Conditions:
40
- {{ addon_config.prefix }}HasAutomaticFailoverEnabled: !Not [!Equals [!FindInMap [{{ addon_config.prefix }}EnvironmentConfigMap, !Ref Env, NumReplicas], 0]]
41
- {{ addon_config.prefix }}CreateProdSubFilter: !Or [!Equals [!Ref Env, prod], !Equals [!Ref Env, production], !Equals [!Ref Env, PROD], !Equals [!Ref Env, PRODUCTION]]
42
-
43
- Resources:
44
-
45
- {{ addon_config.prefix }}CacheParameterGroup:
46
- Type: 'AWS::ElastiCache::ParameterGroup'
47
- DeletionPolicy: !FindInMap [{{ addon_config.prefix }}EnvironmentConfigMap, !Ref Env, DeletionPolicy]
48
- UpdateReplacePolicy: Retain
49
- Properties:
50
- CacheParameterGroupFamily: !FindInMap
51
- - {{ addon_config.prefix }}EngineVersionMap
52
- - !FindInMap [{{ addon_config.prefix }}EnvironmentConfigMap, !Ref Env, EngineVersion]
53
- - CacheParameterGroupFamily
54
- Description: !Ref 'AWS::StackName'
55
- Properties: {}
56
-
57
- {{ addon_config.prefix }}CacheSubnetGroupName:
58
- Type: 'AWS::ElastiCache::SubnetGroup'
59
- DeletionPolicy: !FindInMap [{{ addon_config.prefix }}EnvironmentConfigMap, !Ref Env, DeletionPolicy]
60
- UpdateReplacePolicy: Retain
61
- Properties:
62
- Description: !Ref 'AWS::StackName'
63
- SubnetIds: !Split [ ",", !Ref PrivateSubnets ]
64
-
65
- {{ addon_config.prefix }}SecurityGroup:
66
- Type: 'AWS::EC2::SecurityGroup'
67
- DeletionPolicy: !FindInMap [{{ addon_config.prefix }}EnvironmentConfigMap, !Ref Env, DeletionPolicy]
68
- UpdateReplacePolicy: Retain
69
- Properties:
70
- GroupDescription: !Ref 'AWS::StackName'
71
- VpcId: !Ref VpcId
72
- SecurityGroupIngress:
73
- - IpProtocol: tcp
74
- FromPort: 6379
75
- ToPort: 6379
76
- SourceSecurityGroupId: !Ref EnvironmentSecurityGroup
77
- Tags:
78
- - Key: Name
79
- Value: !Sub 'copilot-${App}-${Env}-{{ addon_config.name }}-Redis-SecurityGroup'
80
-
81
- {{ addon_config.prefix }}ReplicationGroup:
82
- Type: 'AWS::ElastiCache::ReplicationGroup'
83
- DeletionPolicy: !FindInMap [{{ addon_config.prefix }}EnvironmentConfigMap, !Ref Env, DeletionPolicy]
84
- UpdateReplacePolicy: Retain
85
- Properties:
86
- ReplicationGroupDescription: !Ref 'AWS::StackName'
87
- AtRestEncryptionEnabled: true
88
- AutomaticFailoverEnabled: !If [{{ addon_config.prefix }}HasAutomaticFailoverEnabled, true, false]
89
- MultiAZEnabled: !If [{{ addon_config.prefix }}HasAutomaticFailoverEnabled, true, false]
90
- CacheNodeType: !FindInMap [{{ addon_config.prefix }}EnvironmentConfigMap, !Ref Env, CacheNodeType]
91
- CacheParameterGroupName: !Ref {{ addon_config.prefix }}CacheParameterGroup
92
- CacheSubnetGroupName: !Ref {{ addon_config.prefix }}CacheSubnetGroupName
93
- Engine: redis
94
- EngineVersion: !FindInMap [{{ addon_config.prefix }}EnvironmentConfigMap, !Ref Env, EngineVersion]
95
- NumNodeGroups: 1 # run in non clustered mode with 1 master and 0-5 replicas
96
- ReplicasPerNodeGroup: !FindInMap [{{ addon_config.prefix }}EnvironmentConfigMap, !Ref Env, NumReplicas]
97
- PreferredMaintenanceWindow: 'sat:07:00-sat:08:00'
98
- LogDeliveryConfigurations:
99
- - DestinationDetails:
100
- CloudWatchLogsDetails:
101
- LogGroup: !Sub '/aws/elasticache/${App}/${Env}/{{ addon_config.prefix }}/slow'
102
- DestinationType: cloudwatch-logs
103
- LogFormat: json
104
- LogType: slow-log
105
- - DestinationDetails:
106
- CloudWatchLogsDetails:
107
- LogGroup: !Sub '/aws/elasticache/${App}/${Env}/{{ addon_config.prefix }}/engine'
108
- DestinationType: cloudwatch-logs
109
- LogFormat: json
110
- LogType: engine-log
111
- SecurityGroupIds:
112
- - !Ref {{ addon_config.prefix }}SecurityGroup
113
-
114
- TransitEncryptionEnabled: true
115
- # UpdatePolicy:
116
- # UseOnlineResharding: true
117
-
118
- {{ addon_config.prefix }}RedisSlowLogGroup:
119
- Type: AWS::Logs::LogGroup
120
- Properties:
121
- LogGroupName: !Sub '/aws/elasticache/${App}/${Env}/{{ addon_config.prefix }}/slow'
122
- RetentionInDays: 7
123
- Tags:
124
- - Key: 'Copilot-Application'
125
- Value: !Sub ${App}
126
- - Key: 'Copilot-Environment'
127
- Value: !Sub ${Env}
128
-
129
- {{ addon_config.prefix }}RedisEngineLogGroup:
130
- Type: AWS::Logs::LogGroup
131
- Properties:
132
- LogGroupName: !Sub '/aws/elasticache/${App}/${Env}/{{ addon_config.prefix }}/engine'
133
- RetentionInDays: 7
134
- Tags:
135
- - Key: 'Copilot-Application'
136
- Value: !Sub ${App}
137
- - Key: 'Copilot-Environment'
138
- Value: !Sub ${Env}
139
-
140
- # Redis endpoint stored in SSM so that other `services` can retrieve the endpoint.
141
- {{ addon_config.prefix }}EndpointAddressParam:
142
- Type: AWS::SSM::Parameter
143
- Properties:
144
- Name: !Sub '/copilot/${App}/${Env}/secrets/{{ addon_config.secret_name }}' # Other services can retrieve the endpoint from this path.
145
- Type: String
146
- Value: !Sub
147
- - 'rediss://${url}:${port}'
148
- - url: !GetAtt '{{ addon_config.prefix }}ReplicationGroup.PrimaryEndPoint.Address'
149
- port: !GetAtt '{{ addon_config.prefix }}ReplicationGroup.PrimaryEndPoint.Port'
150
-
151
- {{ addon_config.prefix }}SubscriptionFilterEngine:
152
- Type: AWS::Logs::SubscriptionFilter
153
- DependsOn:
154
- - {{ addon_config.prefix }}RedisEngineLogGroup
155
- Properties:
156
- RoleArn: !Sub 'arn:aws:iam::${AWS::AccountId}:role/CWLtoSubscriptionFilterRole'
157
- LogGroupName: !Sub '/aws/elasticache/${App}/${Env}/{{ addon_config.prefix }}/engine'
158
- FilterName: !Sub '/aws/elasticache/${App}/${Env}/${{ '{' }}{{ addon_config.prefix }}ReplicationGroup}/engine'
159
- FilterPattern: ''
160
- DestinationArn: !If [{{ addon_config.prefix }}CreateProdSubFilter, '{{ log_destination.prod }}', '{{ log_destination.dev }}']
161
-
162
- {{ addon_config.prefix }}SubscriptionFilterSlow:
163
- Type: AWS::Logs::SubscriptionFilter
164
- DependsOn:
165
- - {{ addon_config.prefix }}RedisSlowLogGroup
166
- Properties:
167
- RoleArn: !Sub 'arn:aws:iam::${AWS::AccountId}:role/CWLtoSubscriptionFilterRole'
168
- LogGroupName: !Sub '/aws/elasticache/${App}/${Env}/{{ addon_config.prefix }}/slow'
169
- FilterName: !Sub '/aws/elasticache/${App}/${Env}/${{ '{' }}{{ addon_config.prefix }}ReplicationGroup}/slow'
170
- FilterPattern: ''
171
- DestinationArn: !If [{{ addon_config.prefix }}CreateProdSubFilter, '{{ log_destination.prod }}', '{{ log_destination.dev }}']
@@ -1,219 +0,0 @@
1
- # {% extra_header %}
2
- # {% version_info %}
3
- Transform: AWS::LanguageExtensions
4
-
5
- Parameters:
6
- # Copilot required Parameters...
7
- App:
8
- Type: String
9
- Description: Your application's name.
10
- Env:
11
- Type: String
12
- Description: The environment name your service, job, or workflow is being deployed to.
13
-
14
- Mappings:
15
- {{ addon_config.prefix }}EnvironmentConfigMap:
16
- # Create an entry for each environment
17
- {% for env_name, config in addon_config.environments.items() %}
18
- {{ env_name }}:
19
- BucketName: '{{ config.bucket_name }}'
20
- DeletionPolicy: {{ config.deletion_policy }}
21
- {%- if config.retention_policy %}
22
- RetentionMode: {{ config.retention_policy.mode }}
23
- {%- if config.retention_policy.days %}
24
- RetentionDurationType: Days
25
- RetentionDuration: {{ config.retention_policy.days }}
26
- {%- else %}
27
- RetentionDurationType: Years
28
- RetentionDuration: {{ config.retention_policy.years }}
29
- {%- endif %}
30
- {%- endif %}
31
- {%- endfor %}
32
-
33
- Conditions:
34
- {{ addon_config.prefix }}ApplyRetentionPolicy: !Not
35
- - !Equals
36
- - !FindInMap
37
- - {{ addon_config.prefix }}EnvironmentConfigMap
38
- - !Ref Env
39
- - RetentionMode
40
- - DefaultValue: No retention
41
- - No retention
42
- {{ addon_config.prefix }}RetentionPolicyDurationIsInDays: !Equals
43
- - !FindInMap
44
- - {{ addon_config.prefix }}EnvironmentConfigMap
45
- - !Ref Env
46
- - RetentionDurationType
47
- - DefaultValue: Days
48
- - Days
49
-
50
- Resources:
51
- {{ addon_config.prefix }}KMSKey:
52
- Type: "AWS::KMS::Key"
53
- DeletionPolicy: !FindInMap [{{ addon_config.prefix }}EnvironmentConfigMap, !Ref Env, DeletionPolicy]
54
- UpdateReplacePolicy: Retain
55
- Properties:
56
- Description: "KMS Key for RDS encryption"
57
- KeyPolicy:
58
- Version: '2012-10-17'
59
- Id: !Sub '${App}-${Env}-{{ addon_config.prefix }}-key'
60
- Statement:
61
- - Sid: Enable IAM User Permissions
62
- Effect: Allow
63
- Principal:
64
- AWS: !Sub "arn:aws:iam::${AWS::AccountId}:root"
65
- Action: kms:*
66
- Resource: '*'
67
-
68
- {{ addon_config.prefix }}KeyAlias:
69
- Type: 'AWS::KMS::Alias'
70
- DeletionPolicy: !FindInMap [{{ addon_config.prefix }}EnvironmentConfigMap, !Ref Env, DeletionPolicy]
71
- UpdateReplacePolicy: Retain
72
- Properties:
73
- AliasName: !Sub 'alias/${App}-${Env}-{{ addon_config.prefix }}-key'
74
- TargetKeyId: !Ref {{ addon_config.prefix }}KMSKey
75
-
76
- {{ addon_config.prefix }}Bucket:
77
- Metadata:
78
- 'aws:copilot:description': 'An Amazon S3 bucket to store and retrieve objects for {{ addon_config.prefix }}'
79
- Type: AWS::S3::Bucket
80
- DeletionPolicy: !FindInMap [{{ addon_config.prefix }}EnvironmentConfigMap, !Ref Env, DeletionPolicy]
81
- UpdateReplacePolicy: Retain
82
- Properties:
83
- BucketName: !FindInMap [{{ addon_config.prefix }}EnvironmentConfigMap, !Ref Env, BucketName]
84
- AccessControl: Private
85
- BucketEncryption:
86
- ServerSideEncryptionConfiguration:
87
- - ServerSideEncryptionByDefault:
88
- SSEAlgorithm: aws:kms
89
- KMSMasterKeyID: !Ref {{ addon_config.prefix }}KMSKey
90
- ObjectLockConfiguration:
91
- !If
92
- - {{ addon_config.prefix }}ApplyRetentionPolicy
93
- - ObjectLockEnabled: Enabled
94
- Rule:
95
- DefaultRetention: !If
96
- - {{ addon_config.prefix }}RetentionPolicyDurationIsInDays
97
- - Mode: !FindInMap [{{ addon_config.prefix }}EnvironmentConfigMap, !Ref Env, RetentionMode]
98
- Days: !FindInMap
99
- - {{ addon_config.prefix }}EnvironmentConfigMap
100
- - !Ref Env
101
- - RetentionDuration
102
- - Mode: !FindInMap [{{ addon_config.prefix }}EnvironmentConfigMap, !Ref Env, RetentionMode]
103
- Years: !FindInMap
104
- - {{ addon_config.prefix }}EnvironmentConfigMap
105
- - !Ref Env
106
- - RetentionDuration
107
- - !Ref AWS::NoValue
108
- VersioningConfiguration:
109
- Status: Enabled
110
- PublicAccessBlockConfiguration:
111
- BlockPublicAcls: true
112
- BlockPublicPolicy: true
113
- IgnorePublicAcls: true
114
- RestrictPublicBuckets: true
115
- Tags:
116
- - Key: Copilot-application
117
- Value: !Ref App
118
- - Key: Copilot-environment
119
- Value: !Ref Env
120
- - Key: Copilot-deletion-policy
121
- Value: !FindInMap [{{ addon_config.prefix }}EnvironmentConfigMap, !Ref Env, DeletionPolicy]
122
-
123
- {{ addon_config.prefix }}BucketPolicy:
124
- Metadata:
125
- 'aws:copilot:description': 'A bucket policy to deny unencrypted access to the bucket and its contents'
126
- Type: AWS::S3::BucketPolicy
127
- DeletionPolicy: !FindInMap [{{ addon_config.prefix }}EnvironmentConfigMap, !Ref Env, DeletionPolicy]
128
- UpdateReplacePolicy: Retain
129
- Properties:
130
- PolicyDocument:
131
- Version: '2012-10-17'
132
- Statement:
133
- - Sid: ForceHTTPS
134
- Effect: Deny
135
- Principal: '*'
136
- Action: 's3:*'
137
- Resource:
138
- - !Sub ${ {{ addon_config.prefix }}Bucket.Arn}/*
139
- - !Sub ${ {{ addon_config.prefix }}Bucket.Arn}
140
- Condition:
141
- Bool:
142
- "aws:SecureTransport": false
143
- Bucket: !Ref {{ addon_config.prefix }}Bucket
144
-
145
- {% if 'objects' in addon_config %}
146
- {{ addon_config.prefix }}S3ObjectUploader:
147
- Type: AWS::Lambda::Function
148
- Properties:
149
- FunctionName: !Sub "${App}-${Env}-object-uploader"
150
- Handler: index.handler
151
- Runtime: python3.11
152
- MemorySize: 128
153
- Timeout: 10
154
- Role: !GetAtt {{ addon_config.prefix }}S3ObjectUploaderRole.Arn
155
- Code:
156
- ZipFile: |
157
- {{ addon_config.custom_resources.s3_object(10) }}
158
-
159
- {{ addon_config.prefix }}S3ObjectUploaderRole:
160
- Type: AWS::IAM::Role
161
- Properties:
162
- RoleName: !Sub "${App}-${Env}-object-uploader-role"
163
- AssumeRolePolicyDocument:
164
- Version: 2012-10-17
165
- Statement:
166
- - Effect: Allow
167
- Action:
168
- - 'sts:AssumeRole'
169
- Principal:
170
- Service:
171
- - lambda.amazonaws.com
172
- Policies:
173
- - PolicyName: !Sub "${App}-${Env}-object-uploader-policy"
174
- PolicyDocument:
175
- Version: '2012-10-17'
176
- Statement:
177
- - Effect: Allow
178
- Action:
179
- - 's3:PutObject'
180
- - 's3:DeleteObject'
181
- Resource:
182
- - !Sub ${ {{ addon_config.prefix }}Bucket.Arn }/*
183
- - Effect: Allow
184
- Action:
185
- - 'logs:CreateLogGroup'
186
- - 'logs:CreateLogStream'
187
- - 'logs:PutLogEvents'
188
- Resource: 'arn:aws:logs:*:*:*'
189
- - Effect: Allow
190
- Action:
191
- - 'kms:GenerateDataKey'
192
- Resource: !GetAtt {{ addon_config.prefix }}KMSKey.Arn
193
-
194
- {% for s3object in addon_config.objects %}
195
- {{ addon_config.prefix }}S3Object{{ loop.index0 }}:
196
- Type: 'Custom::S3ObjectUploader'
197
- Properties:
198
- ServiceToken: !GetAtt {{ addon_config.prefix }}S3ObjectUploader.Arn
199
- CopilotApplication: !Sub "${App}"
200
- CopilotEnvironment: !Sub "${Env}"
201
- S3Bucket: !Ref {{ addon_config.prefix }}Bucket
202
- S3ObjectKey: {{ s3object.key }}
203
- S3ObjectBody: {{ s3object.body }}
204
- {% if s3object.content_type %}
205
- S3ObjectContentType: {{ s3object.content_type }}
206
- {% endif %}
207
- {% endfor %}
208
- {% endif %}
209
-
210
- Outputs:
211
- {{ addon_config.prefix }}Name:
212
- Description: "The name of a user-defined bucket."
213
- Value: !Ref {{ addon_config.prefix }}Bucket
214
-
215
- {{ addon_config.prefix }}KMSKeyARN:
216
- Description: "ARN of the KMS Key"
217
- Value: !GetAtt {{ addon_config.prefix }}KMSKey.Arn
218
- Export:
219
- Name: !Sub "${App}-${Env}-{{ addon_config.prefix }}-KMSKeyARN"
@@ -1,120 +0,0 @@
1
- # {% extra_header %}
2
- # {% version_info %}
3
-
4
- Parameters:
5
- App:
6
- Type: String
7
- Description: Your application's name.
8
- Env:
9
- Type: String
10
- Description: The environment name your service, job, or workflow is being deployed to.
11
-
12
- EnvironmentSecurityGroup:
13
- Type: String
14
- PrivateSubnets:
15
- Type: String
16
- PublicSubnets:
17
- Type: String
18
- VpcId:
19
- Type: String
20
-
21
- Resources:
22
- # Secrets Manager VPC endpoint
23
- VpcEndpoint:
24
- Type: AWS::EC2::VPCEndpoint
25
- # Resource based metadata block to ignore reference to resources in other addon templates. Do not remove.
26
- Metadata:
27
- cfn-lint:
28
- config:
29
- ignore_checks:
30
- # https://github.com/aws-cloudformation/cfn-lint/blob/main/docs/rules.md
31
- - E1010
32
- Properties:
33
- PrivateDnsEnabled: true
34
- SecurityGroupIds:
35
- {%- for addon, config in addons -%}
36
- {%- set prefix = addon.split('-')|first|lower ~ addon.split('-')[1:]|map('capitalize')|join -%}
37
- {%- if config.type == "aurora-postgres" %}
38
- - !GetAtt {{ prefix }}DBClusterSecurityGroup.GroupId
39
- {%- endif -%}
40
- {%- if config.type == "postgres" %}
41
- - !GetAtt {{ prefix }}SecurityGroup.GroupId
42
- {%- endif -%}
43
- {%- endfor %}
44
- - !Ref EnvironmentSecurityGroup
45
- ServiceName: 'com.amazonaws.eu-west-2.secretsmanager'
46
- SubnetIds: !Split [ ",", !Ref PrivateSubnets ]
47
- VpcEndpointType: Interface
48
- VpcId: !Ref VpcId
49
-
50
- AdditionalNatGatewayAttachment1:
51
- Metadata:
52
- 'aws:copilot:description': 'An Elastic IP for an additional NAT Gateway 1'
53
- Type: AWS::EC2::EIP
54
- Properties:
55
- Domain: vpc
56
-
57
- AdditionalNatGatewayAttachment2:
58
- Metadata:
59
- 'aws:copilot:description': 'An Elastic IP for an additional NAT Gateway 2'
60
- Type: AWS::EC2::EIP
61
- Properties:
62
- Domain: vpc
63
-
64
- AdditionalNatGateway1:
65
- Metadata:
66
- 'aws:copilot:description': 'Additional NAT Gateway 1'
67
- Type: AWS::EC2::NatGateway
68
- Properties:
69
- AllocationId: !GetAtt AdditionalNatGatewayAttachment1.AllocationId
70
- SubnetId: !Select [ 0, !Split [ ",", !Ref PublicSubnets ] ]
71
- Tags:
72
- - Key: Name
73
- Value: !Sub 'copilot-${App}-${Env}-Additional-NAT-Gateway-1'
74
-
75
- AdditionalNatGateway2:
76
- Metadata:
77
- 'aws:copilot:description': 'Additional NAT Gateway 2'
78
- Type: AWS::EC2::NatGateway
79
- Properties:
80
- AllocationId: !GetAtt AdditionalNatGatewayAttachment2.AllocationId
81
- SubnetId: !Select [ 1, !Split [ ",", !Ref PublicSubnets ] ]
82
- Tags:
83
- - Key: Name
84
- Value: !Sub 'copilot-${App}-${Env}-Additional-NAT-Gateway-2'
85
-
86
- AdditionalPrivateRouteTable1:
87
- Type: AWS::EC2::RouteTable
88
- Properties:
89
- VpcId: !Ref VpcId
90
-
91
- AdditionalPrivateRouteTable2:
92
- Type: AWS::EC2::RouteTable
93
- Properties:
94
- VpcId: !Ref VpcId
95
-
96
- AdditionalPrivateRoute1:
97
- Type: AWS::EC2::Route
98
- Properties:
99
- RouteTableId: !Ref AdditionalPrivateRouteTable1
100
- DestinationCidrBlock: 0.0.0.0/0
101
- NatGatewayId: !Ref AdditionalNatGateway1
102
-
103
- AdditionalPrivateRoute2:
104
- Type: AWS::EC2::Route
105
- Properties:
106
- RouteTableId: !Ref AdditionalPrivateRouteTable2
107
- DestinationCidrBlock: 0.0.0.0/0
108
- NatGatewayId: !Ref AdditionalNatGateway2
109
-
110
- AdditionalPrivateRouteTable1Association:
111
- Type: AWS::EC2::SubnetRouteTableAssociation
112
- Properties:
113
- RouteTableId: !Ref AdditionalPrivateRouteTable1
114
- SubnetId: !Select [ 0, !Split [ ",", !Ref PrivateSubnets ] ]
115
-
116
- AdditionalPrivateRouteTable2Association:
117
- Type: AWS::EC2::SubnetRouteTableAssociation
118
- Properties:
119
- RouteTableId: !Ref AdditionalPrivateRouteTable2
120
- SubnetId: !Select [ 1, !Split [ ",", !Ref PrivateSubnets ] ]
@@ -1,34 +0,0 @@
1
- import glob
2
- from subprocess import run
3
-
4
- import click
5
-
6
-
7
- def get_lint_result(path: str, ignore_path: str = None, ignore_checks: str = None):
8
- command = ["cfn-lint", path]
9
- if ignore_path:
10
- command.extend(["--ignore-templates", ignore_path])
11
- if ignore_checks:
12
- command.extend(["--ignore-checks", ignore_checks])
13
-
14
- click.secho(f"\n>>> Running lint check", fg="yellow")
15
- click.secho(f""" {" ".join(command)}\n""", fg="yellow")
16
-
17
- return run(command, capture_output=True)
18
-
19
-
20
- def get_check_security_result(path: str, ignore_path: str = None):
21
- matching_files = glob.glob(path)
22
- command = ["checkov", "--quiet", "--framework", "cloudformation"]
23
-
24
- for file in matching_files:
25
- command.extend(["--file", file])
26
-
27
- if ignore_path:
28
- for ignored_file in glob.glob(ignore_path):
29
- command.extend(["--skip-path", ignore_path])
30
-
31
- click.secho(f"\n>>> Running security check", fg="yellow")
32
- click.secho(f""" {" ".join(command)}\n""", fg="yellow")
33
-
34
- return run(command, capture_output=True)