Skip to content

Commit

Permalink
feat(ecs): enable fault injection flag (#32598)
Browse files Browse the repository at this point in the history
### Issue # (if applicable)

N/A

### Reason for this change
Add a missing property.



### Description of changes
Add `enableFaultInjection` property.



### Describe any new or updated permissions being added
No


### Description of how you validated changes
Add unit test and integ test


### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
mazyu36 authored Jan 7, 2025
1 parent 3606deb commit ed366ce
Show file tree
Hide file tree
Showing 12 changed files with 736 additions and 9 deletions.

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

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

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,124 @@
{
"Resources": {
"Ec2TaskDefinitionTaskRole0B78BC85": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "ecs-tasks.amazonaws.com"
}
}
],
"Version": "2012-10-17"
}
}
},
"Ec2TaskDefinitionB25030BE": {
"Type": "AWS::ECS::TaskDefinition",
"Properties": {
"ContainerDefinitions": [
{
"Essential": true,
"Image": "public.ecr.aws/ecs-sample-image/amazon-ecs-sample:latest",
"Memory": 512,
"Name": "Ec2Container"
}
],
"EnableFaultInjection": true,
"Family": "awsecstaskdefinitionenablefaultinjectionEc2TaskDefinition28DF45DB",
"NetworkMode": "host",
"RequiresCompatibilities": [
"EC2"
],
"TaskRoleArn": {
"Fn::GetAtt": [
"Ec2TaskDefinitionTaskRole0B78BC85",
"Arn"
]
}
}
},
"FargateTaskDefinitionTaskRoleE3C2BCAA": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "ecs-tasks.amazonaws.com"
}
}
],
"Version": "2012-10-17"
}
}
},
"FargateTaskDefinition8E3B365E": {
"Type": "AWS::ECS::TaskDefinition",
"Properties": {
"ContainerDefinitions": [
{
"Essential": true,
"Image": "public.ecr.aws/ecs-sample-image/amazon-ecs-sample:latest",
"Memory": 512,
"Name": "FargateContainer"
}
],
"Cpu": "256",
"EnableFaultInjection": true,
"Family": "awsecstaskdefinitionenablefaultinjectionFargateTaskDefinition203B68EF",
"Memory": "512",
"NetworkMode": "awsvpc",
"RequiresCompatibilities": [
"FARGATE"
],
"TaskRoleArn": {
"Fn::GetAtt": [
"FargateTaskDefinitionTaskRoleE3C2BCAA",
"Arn"
]
}
}
}
},
"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.

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

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

Loading

0 comments on commit ed366ce

Please sign in to comment.