dbt-platform-helper 11.3.0__py3-none-any.whl → 12.0.0__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 (33) 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 +0 -3
  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/aws.py +3 -1
  13. dbt_platform_helper/utils/platform_config.py +2 -7
  14. dbt_platform_helper/utils/validation.py +3 -78
  15. {dbt_platform_helper-11.3.0.dist-info → dbt_platform_helper-12.0.0.dist-info}/METADATA +1 -1
  16. {dbt_platform_helper-11.3.0.dist-info → dbt_platform_helper-12.0.0.dist-info}/RECORD +20 -33
  17. platform_helper.py +0 -8
  18. dbt_platform_helper/commands/check_cloudformation.py +0 -87
  19. dbt_platform_helper/commands/dns.py +0 -952
  20. dbt_platform_helper/custom_resources/__init__.py +0 -0
  21. dbt_platform_helper/custom_resources/s3_object.py +0 -85
  22. dbt_platform_helper/templates/addons/env/addons.parameters.yml +0 -19
  23. dbt_platform_helper/templates/addons/env/aurora-postgres.yml +0 -604
  24. dbt_platform_helper/templates/addons/env/monitoring.yml +0 -121
  25. dbt_platform_helper/templates/addons/env/opensearch.yml +0 -257
  26. dbt_platform_helper/templates/addons/env/rds-postgres.yml +0 -603
  27. dbt_platform_helper/templates/addons/env/redis-cluster.yml +0 -171
  28. dbt_platform_helper/templates/addons/env/s3.yml +0 -219
  29. dbt_platform_helper/templates/addons/env/vpc.yml +0 -120
  30. dbt_platform_helper/utils/cloudformation.py +0 -34
  31. {dbt_platform_helper-11.3.0.dist-info → dbt_platform_helper-12.0.0.dist-info}/LICENSE +0 -0
  32. {dbt_platform_helper-11.3.0.dist-info → dbt_platform_helper-12.0.0.dist-info}/WHEEL +0 -0
  33. {dbt_platform_helper-11.3.0.dist-info → dbt_platform_helper-12.0.0.dist-info}/entry_points.txt +0 -0
@@ -1,121 +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
- ECSClusterName:
12
- Type: String
13
- Description: The ECS cluster for this environment.
14
-
15
- Mappings:
16
- {{ addon_config.prefix }}EnvConfiguration:
17
- {% for environment_name, config in addon_config.environments.items() %}
18
- {{ environment_name }}:
19
- EnableOpsCenter: {% if config.enable_ops_center %}true{% else %}false{% endif %}
20
- {% endfor %}
21
-
22
- Resources:
23
- {{ addon_config.prefix }}ComputeDashboard:
24
- Type: AWS::CloudWatch::Dashboard
25
- Properties:
26
- DashboardName: !Sub "${App}-${Env}-Compute"
27
- DashboardBody: !Sub |
28
- {
29
- "widgets": [
30
- {
31
- "height": 7,
32
- "width": 24,
33
- "y": 0,
34
- "x": 0,
35
- "type": "log",
36
- "properties": {
37
- "query": "SOURCE '/aws/ecs/containerinsights/${ECSClusterName}/performance' | fields @message\n| filter Type=\"Task\"\n| filter @logStream like /FargateTelemetry/\n| stats latest(TaskDefinitionFamily) as TaskDefFamily, \n latest(TaskDefinitionRevision) as Rev, \n max(CpuReserved) as TaskCpuReserved, \n avg(CpuUtilized) as AvgCpuUtilized, \n concat(ceil(avg(CpuUtilized) * 100 / TaskCpuReserved),\" %\") as AvgCpuUtilizedPerc, \n max(CpuUtilized) as PeakCpuUtilized, \n concat(ceil(max(CpuUtilized) * 100 / TaskCpuReserved),\" %\") as PeakCpuUtilizedPerc, \n max(MemoryReserved) as TaskMemReserved, \n ceil(avg(MemoryUtilized)) as AvgMemUtilized, \n concat(ceil(avg(MemoryUtilized) * 100 / TaskMemReserved),\" %\") as AvgMemUtilizedPerc, \n max(MemoryUtilized) as PeakMemUtilized, \n concat(ceil(max(MemoryUtilized) * 100 / TaskMemReserved),\" %\") as PeakMemUtilizedPerc \n by TaskId\n| sort TaskDefFamily asc\n",
38
- "region": "eu-west-2",
39
- "stacked": false,
40
- "title": "All Fargate Tasks Configuration and Consumption Details (CPU and Memory)",
41
- "view": "table"
42
- }
43
- },
44
- {
45
- "height": 6,
46
- "width": 15,
47
- "y": 7,
48
- "x": 0,
49
- "type": "log",
50
- "properties": {
51
- "query": "SOURCE '/aws/ecs/containerinsights/${ECSClusterName}/performance' | fields @message\n| filter Type=\"Task\"\n| filter @logStream like /FargateTelemetry/\n| stats latest(TaskDefinitionFamily) as TaskDefFamily, latest(ServiceName) as SvcName, concat(floor((max(CpuReserved) - avg(CpuUtilized)) * 100 / max(CpuReserved)), \" %\") as AvgCpuWastePercentage by TaskId\n| sort AvgCpuWastePercentage desc\n| limit 10",
52
- "stacked": false,
53
- "title": "Top 10 Fargate Tasks with Optimization Opportunities (CPU)",
54
- "view": "table"
55
- }
56
- },
57
- {
58
- "height": 6,
59
- "width": 15,
60
- "y": 13,
61
- "x": 0,
62
- "type": "log",
63
- "properties": {
64
- "query": "SOURCE '/aws/ecs/containerinsights/${ECSClusterName}/performance' | fields @message\n| filter Type=\"Task\"\n| filter @logStream like /FargateTelemetry/\n| stats latest(TaskDefinitionFamily) as TaskDefFamily, latest(ServiceName) as SvcName, concat(floor((max(MemoryReserved) - avg(MemoryUtilized)) * 100 / max(MemoryReserved)), \" %\") as AvgMemWastePercentage by TaskId\n| sort AvgMemWastePercentage desc\n| limit 10",
65
- "stacked": false,
66
- "title": "Top 10 Fargate Tasks with Optimization Opportunities (Memory)",
67
- "view": "table"
68
- }
69
- },
70
- {
71
- "height": 6,
72
- "width": 9,
73
- "y": 7,
74
- "x": 15,
75
- "type": "log",
76
- "properties": {
77
- "query": "SOURCE '/aws/ecs/containerinsights/${ECSClusterName}/performance' | fields @message\n| filter Type = \"Task\"\n| filter @logStream like /FargateTelemetry/\n| stats count_distinct(TaskId) as TotalTasks, avg(CpuReserved) * TotalTasks as TotalCPUReserved, avg(CpuUtilized) * TotalTasks as AvgCPUConsumed by bin(15m) \n",
78
- "region": "eu-west-2",
79
- "stacked": false,
80
- "title": "CPU Reserved Vs Avg Usage (All Fargate Tasks)",
81
- "view": "timeSeries"
82
- }
83
- },
84
- {
85
- "height": 6,
86
- "width": 9,
87
- "y": 13,
88
- "x": 15,
89
- "type": "log",
90
- "properties": {
91
- "query": "SOURCE '/aws/ecs/containerinsights/${ECSClusterName}/performance' | fields @message\n| filter Type = \"Task\"\n| filter @logStream like /FargateTelemetry/\n| stats count_distinct(TaskId) as TotalTasks, avg(MemoryReserved) * TotalTasks as TotalMemReserved, avg(MemoryUtilized) * TotalTasks as AvgMemConsumed by bin(30m) \n",
92
- "stacked": false,
93
- "title": "Memory Reserved Vs Avg Usage (All Fargate Tasks)",
94
- "view": "timeSeries"
95
- }
96
- }
97
- ]
98
- }
99
-
100
- {{ addon_config.prefix }}ResourceGroup:
101
- Type: AWS::ResourceGroups::Group
102
- Properties:
103
- Name: !Sub "${App}-${Env}-group"
104
- Description: !Sub "Resource group for ${App} in ${Env} environment."
105
- ResourceQuery:
106
- Type: TAG_FILTERS_1_0
107
- Query:
108
- TagFilters:
109
- - Key: copilot-application
110
- Values:
111
- - !Sub "${App}"
112
- - Key: copilot-environment
113
- Values:
114
- - !Sub "${Env}"
115
-
116
- {{ addon_config.prefix }}ApplicationInsights:
117
- Type: AWS::ApplicationInsights::Application
118
- Properties:
119
- AutoConfigurationEnabled: true
120
- ResourceGroupName: !Ref {{ addon_config.prefix }}ResourceGroup
121
- OpsCenterEnabled: !FindInMap [{{ addon_config.prefix }}EnvConfiguration, !Ref Env, EnableOpsCenter]
@@ -1,257 +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
- InstanceType: '{{ config.instance }}'
27
- InstanceCount: {{ config.instances }}
28
- DedicatedMaster: {{ config.master|lower }}
29
- VolumeSize: {{ config.volume_size }}
30
- DeletionPolicy: {{ config.deletion_policy }}
31
- {%- endfor %}
32
-
33
- {{ addon_config.prefix }}EngineVersionMap:
34
- '1.0':
35
- EngineVersion: 'OpenSearch_1.0'
36
- '1.1':
37
- EngineVersion: 'OpenSearch_1.1'
38
- '1.2':
39
- EngineVersion: 'OpenSearch_1.2'
40
- '1.3':
41
- EngineVersion: 'OpenSearch_1.3'
42
- '2.3':
43
- EngineVersion: 'OpenSearch_2.3'
44
- '2.5':
45
- EngineVersion: 'OpenSearch_2.5'
46
- '2.7':
47
- EngineVersion: 'OpenSearch_2.7'
48
- '2.9':
49
- EngineVersion: 'OpenSearch_2.9'
50
- '2.11':
51
- EngineVersion: 'OpenSearch_2.11'
52
-
53
- Conditions:
54
- {{ addon_config.prefix }}EnableHA: !Not [!Equals [!FindInMap [{{ addon_config.prefix }}EnvironmentConfigMap, !Ref Env, InstanceCount], 1]]
55
- {{ addon_config.prefix }}CreateProdSubFilter: !Or [!Equals [!Ref Env, prod], !Equals [!Ref Env, production], !Equals [!Ref Env, PROD], !Equals [!Ref Env, PRODUCTION]]
56
-
57
- Resources:
58
- {{ addon_config.prefix }}OpenSearchSecret:
59
- Metadata:
60
- 'aws:copilot:description': 'A Secrets Manager secret to store your OS credentials'
61
- Type: AWS::SecretsManager::Secret
62
- Properties:
63
- Name: !Sub '/copilot/${App}/${Env}/secrets/{{ addon_config.name|upper|replace("-", "_") }}'
64
- Description: !Sub OpenSearch main user secret for ${AWS::StackName}
65
- GenerateSecretString:
66
- SecretStringTemplate: '{"username": "opensearch"}'
67
- GenerateStringKey: "password"
68
- ExcludePunctuation: false
69
- RequireEachIncludedType: true
70
- IncludeSpace: false
71
- PasswordLength: 20
72
- ExcludeCharacters: '[]{}()"@/\;=?&`><:|#'
73
-
74
- # Security group to add OS to the VPC,
75
- # and to allow the Fargate containers to talk to OS
76
- {{ addon_config.prefix }}OpenSearchSecurityGroup:
77
- Metadata:
78
- 'aws:copilot:description': 'A security group to access OS'
79
- Type: AWS::EC2::SecurityGroup
80
- DeletionPolicy: !FindInMap [{{ addon_config.prefix }}EnvironmentConfigMap, !Ref Env, DeletionPolicy]
81
- UpdateReplacePolicy: Retain
82
- Properties:
83
- GroupDescription: 'The Security Group for {{ addon_config.name }} to access OpenSearch.'
84
- VpcId: !Ref VpcId
85
- Tags:
86
- - Key: Name
87
- Value: !Sub 'copilot-${App}-${Env}-{{ addon_config.name }}-OpenSearch-SecurityGroup'
88
-
89
- # Enable ingress from other ECS services created within the environment.
90
- {{ addon_config.prefix }}OpenSearchIngress:
91
- Metadata:
92
- 'aws:copilot:description': 'Allow ingress from containers in my application to the OpenSearch cluster'
93
- Type: AWS::EC2::SecurityGroupIngress
94
- DeletionPolicy: !FindInMap [{{ addon_config.prefix }}EnvironmentConfigMap, !Ref Env, DeletionPolicy]
95
- UpdateReplacePolicy: Retain
96
- Properties:
97
- Description: Ingress Security Group from Fargate containers
98
- GroupId: !Ref '{{ addon_config.prefix }}OpenSearchSecurityGroup'
99
- IpProtocol: tcp
100
- FromPort: 443
101
- ToPort: 443
102
- SourceSecurityGroupId: !Ref EnvironmentSecurityGroup
103
-
104
- {{ addon_config.prefix }}OpenSearchDomain:
105
- Type: 'AWS::OpenSearchService::Domain'
106
- DeletionPolicy: !FindInMap [{{ addon_config.prefix }}EnvironmentConfigMap, !Ref Env, DeletionPolicy]
107
- UpdateReplacePolicy: Retain
108
- Properties:
109
- AccessPolicies:
110
- Version: '2012-10-17'
111
- Statement:
112
- - Effect: Allow
113
- Principal:
114
- AWS: '*'
115
- Action:
116
- - 'es:ESHttp*'
117
- Resource: !Sub 'arn:aws:es:${AWS::Region}:${AWS::AccountId}:domain/{{ (addon_config.name|replace("-", ""))[:15] }}*'
118
- AdvancedSecurityOptions:
119
- Enabled: true
120
- InternalUserDatabaseEnabled: true
121
- MasterUserOptions:
122
- MasterUserName:
123
- !Join [ "", [ '{% raw %}{{resolve:secretsmanager:{% endraw %}', !Ref {{ addon_config.prefix }}OpenSearchSecret, "{% raw %}:SecretString:username}}{% endraw %}" ]]
124
- MasterUserPassword:
125
- !Join [ "", [ '{% raw %}{{resolve:secretsmanager:{% endraw %}', !Ref {{ addon_config.prefix }}OpenSearchSecret, "{% raw %}:SecretString:password}}{% endraw %}" ]]
126
- DomainEndpointOptions:
127
- EnforceHTTPS: true
128
- TLSSecurityPolicy: 'Policy-Min-TLS-1-2-2019-07'
129
- EngineVersion: !FindInMap
130
- - {{ addon_config.prefix }}EngineVersionMap
131
- - !FindInMap [{{ addon_config.prefix }}EnvironmentConfigMap, !Ref Env, EngineVersion]
132
- - EngineVersion
133
- NodeToNodeEncryptionOptions:
134
- Enabled: true
135
- EncryptionAtRestOptions:
136
- Enabled: true
137
- EBSOptions:
138
- EBSEnabled: true
139
- VolumeSize: !FindInMap [{{ addon_config.prefix }}EnvironmentConfigMap, !Ref Env, VolumeSize]
140
- VolumeType: gp2
141
- ClusterConfig:
142
- DedicatedMasterEnabled: !If [{{ addon_config.prefix }}EnableHA, !FindInMap [{{ addon_config.prefix }}EnvironmentConfigMap, !Ref Env, DedicatedMaster], false]
143
- InstanceCount: !FindInMap [{{ addon_config.prefix }}EnvironmentConfigMap, !Ref Env, InstanceCount]
144
- InstanceType: !FindInMap [{{ addon_config.prefix }}EnvironmentConfigMap, !Ref Env, InstanceType]
145
- ZoneAwarenessEnabled: !If [{{ addon_config.prefix }}EnableHA, true, false]
146
- ZoneAwarenessConfig: !If
147
- - {{ addon_config.prefix }}EnableHA
148
- - AvailabilityZoneCount: 2 #Fn::length always resolves to 1 despite there being subnets.
149
- - !Ref "AWS::NoValue"
150
- VPCOptions:
151
- SecurityGroupIds:
152
- - !Ref {{ addon_config.prefix }}OpenSearchSecurityGroup
153
- SubnetIds: !If
154
- - {{ addon_config.prefix }}EnableHA
155
- - !Split [ ",", !Ref PrivateSubnets ]
156
- - - !Select [ 0, !Split [ ',', !Ref PrivateSubnets ] ]
157
- SoftwareUpdateOptions:
158
- AutoSoftwareUpdateEnabled: true
159
- LogPublishingOptions:
160
- AUDIT_LOGS:
161
- CloudWatchLogsLogGroupArn: !GetAtt {{ addon_config.prefix }}OpenSearchAuditLogGroup.Arn
162
- Enabled: true
163
- ES_APPLICATION_LOGS:
164
- CloudWatchLogsLogGroupArn: !GetAtt {{ addon_config.prefix }}OpenSearchApplicationLogGroup.Arn
165
- Enabled: true
166
- SEARCH_SLOW_LOGS:
167
- CloudWatchLogsLogGroupArn: !GetAtt {{ addon_config.prefix }}OpenSearchSlowSearchLogGroup.Arn
168
- Enabled: true
169
- INDEX_SLOW_LOGS:
170
- CloudWatchLogsLogGroupArn: !GetAtt {{ addon_config.prefix }}OpenSearchSlowIndexLogGroup.Arn
171
- Enabled: true
172
- Tags:
173
- - Key: Name
174
- Value: !Sub 'copilot-${App}-${Env}-{{ addon_config.name }}-OpenSearch-Domain'
175
- - Key: 'Copilot-Application'
176
- Value: !Sub ${App}
177
- - Key: 'Copilot-Environment'
178
- Value: !Sub ${Env}
179
-
180
- {{ addon_config.prefix }}OpenSearchEndpointConfigParam:
181
- Type: AWS::SSM::Parameter
182
- DependsOn:
183
- - {{ addon_config.prefix }}OpenSearchDomain
184
- Properties:
185
- Name: !Sub "/copilot/${App}/${Env}/secrets/{{ addon_config.secret_name }}"
186
- Type: String
187
- Value: !Sub
188
- - "https://${username}:${password}@${url}"
189
- - url: !GetAtt {{ addon_config.prefix }}OpenSearchDomain.DomainEndpoint
190
- username: !Join [ "", [ '{% raw %}{{resolve:secretsmanager:{% endraw %}', !Ref {{ addon_config.prefix }}OpenSearchSecret, "{% raw %}:SecretString:username}}{% endraw %}" ]]
191
- password: !Join [ "", [ '{% raw %}{{resolve:secretsmanager:{% endraw %}', !Ref {{ addon_config.prefix }}OpenSearchSecret, "{% raw %}:SecretString:password}}{% endraw %}" ]]
192
-
193
- {{ addon_config.prefix }}OpenSearchAuditLogGroup:
194
- Type: AWS::Logs::LogGroup
195
- Properties:
196
- LogGroupName: !Sub '/aws/opensearch/${App}/${Env}/{{ addon_config.prefix }}/audit'
197
- RetentionInDays: 7
198
- Tags:
199
- - Key: 'Copilot-Application'
200
- Value: !Sub ${App}
201
- - Key: 'Copilot-Environment'
202
- Value: !Sub ${Env}
203
-
204
- {{ addon_config.prefix }}OpenSearchApplicationLogGroup:
205
- Type: AWS::Logs::LogGroup
206
- Properties:
207
- LogGroupName: !Sub '/aws/opensearch/${App}/${Env}/{{ addon_config.prefix }}/application'
208
- RetentionInDays: 7
209
- Tags:
210
- - Key: 'Copilot-Application'
211
- Value: !Sub ${App}
212
- - Key: 'Copilot-Environment'
213
- Value: !Sub ${Env}
214
-
215
- {{ addon_config.prefix }}OpenSearchSlowSearchLogGroup:
216
- Type: AWS::Logs::LogGroup
217
- Properties:
218
- LogGroupName: !Sub '/aws/opensearch/${App}/${Env}/{{ addon_config.prefix }}/slow-search'
219
- RetentionInDays: 7
220
- Tags:
221
- - Key: 'Copilot-Application'
222
- Value: !Sub ${App}
223
- - Key: 'Copilot-Environment'
224
- Value: !Sub ${Env}
225
-
226
- {{ addon_config.prefix }}OpenSearchSlowIndexLogGroup:
227
- Type: AWS::Logs::LogGroup
228
- Properties:
229
- LogGroupName: !Sub '/aws/opensearch/${App}/${Env}/{{ addon_config.prefix }}/slow-index'
230
- RetentionInDays: 7
231
- Tags:
232
- - Key: 'Copilot-Application'
233
- Value: !Sub ${App}
234
- - Key: 'Copilot-Environment'
235
- Value: !Sub ${Env}
236
-
237
- {{ addon_config.prefix }}SubscriptionFilterApplication:
238
- Type: AWS::Logs::SubscriptionFilter
239
- DependsOn:
240
- - {{ addon_config.prefix }}OpenSearchApplicationLogGroup
241
- Properties:
242
- RoleArn: !Sub 'arn:aws:iam::${AWS::AccountId}:role/CWLtoSubscriptionFilterRole'
243
- LogGroupName: !Sub '/aws/opensearch/${App}/${Env}/{{ addon_config.prefix }}/application'
244
- FilterName: !Sub '/aws/opensearch/${App}/${Env}/${{ '{' }}{{ addon_config.prefix }}OpenSearchDomain}/application'
245
- FilterPattern: ''
246
- DestinationArn: !If [{{ addon_config.prefix }}CreateProdSubFilter, '{{ log_destination.prod }}', '{{ log_destination.dev }}']
247
-
248
- {{ addon_config.prefix }}SubscriptionFilterAudit:
249
- Type: AWS::Logs::SubscriptionFilter
250
- DependsOn:
251
- - {{ addon_config.prefix }}OpenSearchAuditLogGroup
252
- Properties:
253
- RoleArn: !Sub 'arn:aws:iam::${AWS::AccountId}:role/CWLtoSubscriptionFilterRole'
254
- LogGroupName: !Sub '/aws/opensearch/${App}/${Env}/{{ addon_config.prefix }}/audit'
255
- FilterName: !Sub '/aws/opensearch/${App}/${Env}/${{ '{' }}{{ addon_config.prefix }}OpenSearchDomain}/audit'
256
- FilterPattern: ''
257
- DestinationArn: !If [{{ addon_config.prefix }}CreateProdSubFilter, '{{ log_destination.prod }}', '{{ log_destination.dev }}']