File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,7 +80,19 @@ Resources:
8080 DatadogAccountIntegrationTrailBucket :
8181 Type : AWS::S3::Bucket
8282 Properties :
83- BucketName : " automatic-account-integration-trail-bucket"
83+ BucketName :
84+ Fn::Join :
85+ - " -"
86+ - - "datadog-account-integration"
87+ - !Select
88+ - 0
89+ - !Split
90+ - " -"
91+ - !Select
92+ - 2
93+ - !Split
94+ - " /"
95+ - !Ref " AWS::StackId"
8496 DatadogAccountIntegrationTrailBucketPolicy :
8597 Type : AWS::S3::BucketPolicy
8698 Properties :
@@ -149,6 +161,7 @@ Resources:
149161 return
150162
151163 # We need to add a sleep here, to allow AWS finish provisioning of a new AWS account.
164+ print(f"Sleep for 3 minutes to allow AWS finish provisioning of a new AWS account")
152165 time.sleep(180)
153166
154167 newAccountId = event.get("detail").get("serviceEventDetails").get("createAccountStatus").get("accountId")
@@ -209,7 +222,9 @@ Resources:
209222 )
210223
211224 stack_id = response["StackId"]
212-
225+
226+ print(f"Wait for Datadog Integration for account {newAccountId} to be created")
227+
213228 while True:
214229 response = client.describe_stacks(StackName=stack_id)
215230 if response["Stacks"][0]["StackStatus"] == "CREATE_IN_PROGRESS":
@@ -221,7 +236,6 @@ Resources:
221236 break
222237
223238 print(f"Datadog Integration for account {newAccountId} failed to create")
224- print(response)
225239 RuntimeError(f"Datadog Integration for account {newAccountId} failed to create")
226240 Environment :
227241 Variables :
You can’t perform that action at this time.
0 commit comments