Skip to content

Commit

Permalink
update unit tests and integ tests
Browse files Browse the repository at this point in the history
  • Loading branch information
samson-keung committed Jan 23, 2025
1 parent f231856 commit 3f74d79
Show file tree
Hide file tree
Showing 12 changed files with 31,933 additions and 7 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,303 @@
{
"Resources": {
"myAlarmF2E38AF2": {
"Type": "AWS::CloudWatch::Alarm",
"Properties": {
"ComparisonOperator": "GreaterThanOrEqualToThreshold",
"EvaluationPeriods": 1,
"MetricName": "myMetricName",
"Namespace": "myNamespace",
"Period": 300,
"Statistic": "Average",
"Threshold": 0
}
},
"myCRE89CE839": {
"Type": "Custom::AWS",
"Properties": {
"ServiceToken": {
"Fn::GetAtt": [
"AWS679f53fac002430cb0da5b7982bd22872D164C4C",
"Arn"
]
},
"Create": {
"Fn::Join": [
"",
[
"{\"service\":\"CloudWatch\",\"action\":\"tagResource\",\"parameters\":{\"ResourceARN\":\"",
{
"Fn::GetAtt": [
"myAlarmF2E38AF2",
"Arn"
]
},
"\",\"Tags\":[{\"Key\":\"Name\",\"Value\":\"prod\"}]},\"physicalResourceId\":{\"id\":\"add_tag\"},\"logApiResponseData\":true}"
]
]
},
"InstallLatestAwsSdk": true
},
"DependsOn": [
"myCRCustomResourcePolicy05AD5A90"
],
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"myCRCustomResourcePolicy05AD5A90": {
"Type": "AWS::IAM::Policy",
"Properties": {
"PolicyDocument": {
"Statement": [
{
"Action": "cloudwatch:TagResource",
"Effect": "Allow",
"Resource": "*"
}
],
"Version": "2012-10-17"
},
"PolicyName": "myCRCustomResourcePolicy05AD5A90",
"Roles": [
{
"Ref": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2"
}
]
}
},
"AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "lambda.amazonaws.com"
}
}
],
"Version": "2012-10-17"
},
"ManagedPolicyArns": [
{
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
]
]
}
]
}
},
"AWS679f53fac002430cb0da5b7982bd22872D164C4C": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Code": {
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "cde607091ceabfbfb56e643cd4a5647680cfaf19c63f4d59b3f4880df4a71c8d.zip"
},
"Handler": "index.handler",
"MemorySize": 1024,
"Role": {
"Fn::GetAtt": [
"AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2",
"Arn"
]
},
"Runtime": {
"Fn::FindInMap": [
"LatestNodeRuntimeMap",
{
"Ref": "AWS::Region"
},
"value"
]
},
"Timeout": 120
},
"DependsOn": [
"AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2"
]
}
},
"Mappings": {
"LatestNodeRuntimeMap": {
"af-south-1": {
"value": "nodejs20.x"
},
"ap-east-1": {
"value": "nodejs20.x"
},
"ap-northeast-1": {
"value": "nodejs20.x"
},
"ap-northeast-2": {
"value": "nodejs20.x"
},
"ap-northeast-3": {
"value": "nodejs20.x"
},
"ap-south-1": {
"value": "nodejs20.x"
},
"ap-south-2": {
"value": "nodejs20.x"
},
"ap-southeast-1": {
"value": "nodejs20.x"
},
"ap-southeast-2": {
"value": "nodejs20.x"
},
"ap-southeast-3": {
"value": "nodejs20.x"
},
"ap-southeast-4": {
"value": "nodejs20.x"
},
"ap-southeast-5": {
"value": "nodejs20.x"
},
"ap-southeast-7": {
"value": "nodejs20.x"
},
"ca-central-1": {
"value": "nodejs20.x"
},
"ca-west-1": {
"value": "nodejs20.x"
},
"cn-north-1": {
"value": "nodejs18.x"
},
"cn-northwest-1": {
"value": "nodejs18.x"
},
"eu-central-1": {
"value": "nodejs20.x"
},
"eu-central-2": {
"value": "nodejs20.x"
},
"eu-isoe-west-1": {
"value": "nodejs18.x"
},
"eu-north-1": {
"value": "nodejs20.x"
},
"eu-south-1": {
"value": "nodejs20.x"
},
"eu-south-2": {
"value": "nodejs20.x"
},
"eu-west-1": {
"value": "nodejs20.x"
},
"eu-west-2": {
"value": "nodejs20.x"
},
"eu-west-3": {
"value": "nodejs20.x"
},
"il-central-1": {
"value": "nodejs20.x"
},
"me-central-1": {
"value": "nodejs20.x"
},
"me-south-1": {
"value": "nodejs20.x"
},
"mx-central-1": {
"value": "nodejs20.x"
},
"sa-east-1": {
"value": "nodejs20.x"
},
"us-east-1": {
"value": "nodejs20.x"
},
"us-east-2": {
"value": "nodejs20.x"
},
"us-gov-east-1": {
"value": "nodejs18.x"
},
"us-gov-west-1": {
"value": "nodejs18.x"
},
"us-iso-east-1": {
"value": "nodejs18.x"
},
"us-iso-west-1": {
"value": "nodejs18.x"
},
"us-isob-east-1": {
"value": "nodejs18.x"
},
"us-west-1": {
"value": "nodejs20.x"
},
"us-west-2": {
"value": "nodejs20.x"
}
}
},
"Outputs": {
"ExportsOutputFnGetAttmyAlarmF2E38AF2Arn5283D48B": {
"Value": {
"Fn::GetAtt": [
"myAlarmF2E38AF2",
"Arn"
]
},
"Export": {
"Name": "aws-custom-resource-cloudwatch-stack:ExportsOutputFnGetAttmyAlarmF2E38AF2Arn5283D48B"
}
}
},
"Parameters": {
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
"Default": "/cdk-bootstrap/hnb659fds/version",
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
}
},
"Rules": {
"CheckBootstrapVersion": {
"Assertions": [
{
"Assert": {
"Fn::Not": [
{
"Fn::Contains": [
[
"1",
"2",
"3",
"4",
"5"
],
{
"Ref": "BootstrapVersion"
}
]
}
]
},
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
}
]
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3f74d79

Please # to comment.