Skip to content

Commit eb2c3ac

Browse files
authored
Merge pull request #204 from tnguye001/terraform
AWS SRA Terraform Edition
2 parents 87f867e + d78b0bc commit eb2c3ac

File tree

219 files changed

+11815
-13
lines changed

Some content is hidden

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

219 files changed

+11815
-13
lines changed

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,3 +508,13 @@ $RECYCLE.BIN/
508508
**/sra_staging_manual_upload/*
509509
**/dist-*/*
510510
poetry.lock
511+
512+
# Ignore packages generated by TF
513+
**/aws_sra_examples/terraform/**/lambda/
514+
**.terraform
515+
*.tfstate
516+
*.tfstate.*
517+
*.tfvars*
518+
**./terraform
519+
*.hcl
520+
Loading
Loading
Binary file not shown.

aws_sra_examples/solutions/cloudtrail/cloudtrail_org/lambda/src/app.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,3 +358,21 @@ def lambda_handler(event: CloudFormationCustomResourceEvent, context: Context) -
358358
except Exception:
359359
LOGGER.exception(UNEXPECTED)
360360
raise ValueError(f"Unexpected error executing Lambda function. Review CloudWatch logs '{context.log_group_name}' for details.") from None
361+
362+
363+
def terraform_handler(event: CloudFormationCustomResourceEvent, context: Context) -> None:
364+
"""Lambda Handler.
365+
366+
Args:
367+
event: event data
368+
context: runtime information
369+
370+
Raises:
371+
ValueError: Unexpected error executing Lambda function
372+
373+
"""
374+
try:
375+
process_event(event, context)
376+
except Exception:
377+
LOGGER.exception(UNEXPECTED)
378+
raise ValueError(f"Unexpected error executing Lambda function. Review CloudWatch logs '{context.log_group_name}' for details.") from None

aws_sra_examples/solutions/cloudtrail/cloudtrail_org/templates/sra-cloudtrail-org-bucket.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ Resources:
227227
Properties:
228228
Name: sra/cloudtrail_org_s3_bucket
229229
Description: Organization CloudTrail S3 Bucket
230-
SecretString: !Sub '{"OrganizationCloudTrailS3Bucket":"${rOrgTrailBucket}"}' # checkov:skip=CKV_SECRET_6
230+
SecretString: !Sub '{"OrganizationCloudTrailS3Bucket":"${rOrgTrailBucket}"}' # checkov:skip=CKV_SECRET_6
231231
KmsKeyId: !Ref pSRASecretsKeyAliasArn
232232
Tags:
233233
- Key: sra-solution

aws_sra_examples/solutions/cloudtrail/cloudtrail_org/templates/sra-cloudtrail-org-kms.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Resources:
160160
Properties:
161161
Name: sra/cloudtrail_org_key_arn
162162
Description: Organization CloudTrail KMS Key ARN
163-
SecretString: !Sub '{"OrganizationCloudTrailKeyArn":"${rOrganizationCloudTrailKey.Arn}"}' # checkov:skip=CKV_SECRET_6
163+
SecretString: !Sub '{"OrganizationCloudTrailKeyArn":"${rOrganizationCloudTrailKey.Arn}"}' # checkov:skip=CKV_SECRET_6
164164
KmsKeyId: !Ref pSRASecretsKeyAliasArn
165165
Tags:
166166
- Key: sra-solution

0 commit comments

Comments
 (0)