I'm trying to create a scheduled task (CloudWatch Events Rule) in my CloudFormation Template that would have the following EcsParameters:
EcsParameters:
LaunchType: FARGATE
NetworkConfiguration:
AwsVpcConfiguration:
AssignPublicIp: !Ref PublicIpAssignment
SecurityGroups:
- !Ref EcsSecurityGroups
Subnets:
- !Ref SubnetName
TaskCount: 1
TaskDefinitionArn: !Ref TaskDefinitionOne
My ECS CLuster is launched on Fargate and not EC2, and I do NOT have a service running (use case doesn't need a long running process, directly scheduling tasks from events rules.)
Whenever I run this template (with LaunchType
and NetworkConfiguration
) the stack creation fails, with this error:
Encountered unsupported property NetworkConfiguration
As an alternative, I also tried launching the scheduled task from AWS CLI, but it seems like the network config and launch type options are not available there either:
Parameter validation failed: Unknown parameter in Targets[0].EcsParameters: "LaunchType", must be one of: TaskDefinitionArn, TaskCount
According to this page on the AWS Documentation itself, I should be able to specify LaunchType
and NetworkConfiguration
in my EcsParameters
section in Targets
in Properties
of the AWS::Events::Rule
resource.
Is there anything I can try that might work?
We quickly discovered that AWS limits each rule to only 5 targets. You can read more about AWS CloudWatch Event limits here.
CloudFormation supports creating VPCs, subnets, gateways, route tables and network ACLs as well as creating resources such as elastic IPs, Amazon EC2 Instances, EC2 security groups, auto scaling groups, elastic load balancers, Amazon RDS database instances and Amazon RDS security groups in a VPC.
Step 1 => Create your source s3 buckets where you would like data to be uploaded. These buckets become the source for triggering the downstream fargate ecs task.
Even though AWS hasn't updated the documentation by today (Jul.15, 2019) it's working as described by the initial poster.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With