Skip to content

Commit

Permalink
fix(events): remove custom resource for fargate event target (#3952)
Browse files Browse the repository at this point in the history
* chore(events): remove custom resource for fargate event target

The latest CloudFormation specification adds `LaunchType` and `NetworkConfiguration` properties to
the `EcsParameters` property. A custom resource to set those values is no longer needed.

Closes #3930

* fix comma in package.json after fixing merge conflict
  • Loading branch information
jogold authored and mergify[bot] committed Sep 11, 2019
1 parent 73a1de1 commit 920f12f
Show file tree
Hide file tree
Showing 6 changed files with 150 additions and 765 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,25 @@
]
},
"EcsParameters": {
"LaunchType": "FARGATE",
"NetworkConfiguration": {
"AwsVpcConfiguration": {
"AssignPublicIp": "DISABLED",
"SecurityGroups": [
{
"Fn::GetAtt": [
"ScheduledFargateTaskScheduledTaskDefSecurityGroupE075BC19",
"GroupId"
]
}
],
"Subnets": [
{
"Ref": "VpcPrivateSubnet1Subnet536B997A"
}
]
}
},
"TaskCount": 2,
"TaskDefinitionArn": {
"Ref": "ScheduledFargateTaskScheduledTaskDef521FA675"
Expand Down Expand Up @@ -600,173 +619,6 @@
]
}
},
"ScheduledFargateTaskScheduledTaskDefScheduledEventRuleTarget0PutTargets4F6BAABA": {
"Type": "Custom::AWS",
"Properties": {
"ServiceToken": {
"Fn::GetAtt": [
"AWS679f53fac002430cb0da5b7982bd22872D164C4C",
"Arn"
]
},
"Create": {
"service": "CloudWatchEvents",
"apiVersion": "2015-10-07",
"action": "putTargets",
"parameters": {
"Rule": {
"Fn::Select": [
1,
{
"Fn::Split": [
"/",
{
"Fn::Select": [
5,
{
"Fn::Split": [
":",
{
"Fn::GetAtt": [
"ScheduledFargateTaskScheduledEventRule2B79E34F",
"Arn"
]
}
]
}
]
}
]
}
]
},
"Targets": [
{
"Arn": {
"Fn::GetAtt": [
"FargateCluster7CCD5F93",
"Arn"
]
},
"Id": "Target0",
"EcsParameters": {
"TaskDefinitionArn": {
"Ref": "ScheduledFargateTaskScheduledTaskDef521FA675"
},
"LaunchType": "FARGATE",
"NetworkConfiguration": {
"awsvpcConfiguration": {
"Subnets": [
{
"Ref": "VpcPrivateSubnet1Subnet536B997A"
}
],
"AssignPublicIp": "DISABLED",
"SecurityGroups": [
{
"Fn::GetAtt": [
"ScheduledFargateTaskScheduledTaskDefSecurityGroupE075BC19",
"GroupId"
]
}
]
}
},
"TaskCount": 2
},
"Input": "{}",
"RoleArn": {
"Fn::GetAtt": [
"ScheduledFargateTaskScheduledTaskDefEventsRole6CE19522",
"Arn"
]
}
}
]
},
"physicalResourceId": "awsfargateintegScheduledFargateTaskScheduledTaskDefB0AD4F70"
},
"Update": {
"service": "CloudWatchEvents",
"apiVersion": "2015-10-07",
"action": "putTargets",
"parameters": {
"Rule": {
"Fn::Select": [
1,
{
"Fn::Split": [
"/",
{
"Fn::Select": [
5,
{
"Fn::Split": [
":",
{
"Fn::GetAtt": [
"ScheduledFargateTaskScheduledEventRule2B79E34F",
"Arn"
]
}
]
}
]
}
]
}
]
},
"Targets": [
{
"Arn": {
"Fn::GetAtt": [
"FargateCluster7CCD5F93",
"Arn"
]
},
"Id": "Target0",
"EcsParameters": {
"TaskDefinitionArn": {
"Ref": "ScheduledFargateTaskScheduledTaskDef521FA675"
},
"LaunchType": "FARGATE",
"NetworkConfiguration": {
"awsvpcConfiguration": {
"Subnets": [
{
"Ref": "VpcPrivateSubnet1Subnet536B997A"
}
],
"AssignPublicIp": "DISABLED",
"SecurityGroups": [
{
"Fn::GetAtt": [
"ScheduledFargateTaskScheduledTaskDefSecurityGroupE075BC19",
"GroupId"
]
}
]
}
},
"TaskCount": 2
},
"Input": "{}",
"RoleArn": {
"Fn::GetAtt": [
"ScheduledFargateTaskScheduledTaskDefEventsRole6CE19522",
"Arn"
]
}
}
]
},
"physicalResourceId": "awsfargateintegScheduledFargateTaskScheduledTaskDefB0AD4F70"
}
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62cServiceRoleD788AA17": {
"Type": "AWS::IAM::Role",
"Properties": {
Expand Down Expand Up @@ -912,128 +764,6 @@
"AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62cServiceRoleDefaultPolicy6BC8737C",
"AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62cServiceRoleD788AA17"
]
},
"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"
]
]
}
]
}
},
"AWS679f53fac002430cb0da5b7982bd2287ServiceRoleDefaultPolicyD28E1A5E": {
"Type": "AWS::IAM::Policy",
"Properties": {
"PolicyDocument": {
"Statement": [
{
"Action": "events:PutTargets",
"Effect": "Allow",
"Resource": {
"Fn::GetAtt": [
"ScheduledFargateTaskScheduledEventRule2B79E34F",
"Arn"
]
}
},
{
"Action": "iam:PassRole",
"Effect": "Allow",
"Resource": {
"Fn::GetAtt": [
"ScheduledFargateTaskScheduledTaskDefEventsRole6CE19522",
"Arn"
]
}
}
],
"Version": "2012-10-17"
},
"PolicyName": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleDefaultPolicyD28E1A5E",
"Roles": [
{
"Ref": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2"
}
]
}
},
"AWS679f53fac002430cb0da5b7982bd22872D164C4C": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Code": {
"S3Bucket": {
"Ref": "AWS679f53fac002430cb0da5b7982bd2287CodeS3BucketF55839B6"
},
"S3Key": {
"Fn::Join": [
"",
[
{
"Fn::Select": [
0,
{
"Fn::Split": [
"||",
{
"Ref": "AWS679f53fac002430cb0da5b7982bd2287CodeS3VersionKey3C45B02F"
}
]
}
]
},
{
"Fn::Select": [
1,
{
"Fn::Split": [
"||",
{
"Ref": "AWS679f53fac002430cb0da5b7982bd2287CodeS3VersionKey3C45B02F"
}
]
}
]
}
]
]
}
},
"Handler": "index.handler",
"Role": {
"Fn::GetAtt": [
"AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2",
"Arn"
]
},
"Runtime": "nodejs10.x"
},
"DependsOn": [
"AWS679f53fac002430cb0da5b7982bd2287ServiceRoleDefaultPolicyD28E1A5E",
"AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2"
]
}
},
"Parameters": {
Expand All @@ -1052,18 +782,6 @@
"AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62cCodeArtifactHash8BCBAA49": {
"Type": "String",
"Description": "Artifact hash for asset \"aws-fargate-integ/AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62c/Code\""
},
"AWS679f53fac002430cb0da5b7982bd2287CodeS3BucketF55839B6": {
"Type": "String",
"Description": "S3 bucket for asset \"aws-fargate-integ/AWS679f53fac002430cb0da5b7982bd2287/Code\""
},
"AWS679f53fac002430cb0da5b7982bd2287CodeS3VersionKey3C45B02F": {
"Type": "String",
"Description": "S3 key for asset version \"aws-fargate-integ/AWS679f53fac002430cb0da5b7982bd2287/Code\""
},
"AWS679f53fac002430cb0da5b7982bd2287CodeArtifactHash49FACC2E": {
"Type": "String",
"Description": "Artifact hash for asset \"aws-fargate-integ/AWS679f53fac002430cb0da5b7982bd2287/Code\""
}
}
}
Loading

0 comments on commit 920f12f

Please sign in to comment.