Questions tagged with Amazon Elastic Container Service

Content language: English

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

ECS agent sporadically times out while fetching secrets from SSM Parameter Store

We have an ECS cluster in us-west-2 that runs a few ECS services. We run some ECS tasks that are invoked periodically via EventBridge. All tasks use the EC2 launch type and run on container instances that we manage with an Auto Scaling Group. AMI used currently is amzn2-ami-ecs-hvm-2.0.20220630-x86_64-ebs. Container instances are launched in private subnets and VPC endpoints are set up for a few AWS services, including SSM. A few months ago we started seeing missed checkins from the periodically launched tasks and saw that at least some of them failed to launch due to a timeout from the SSM API endpoint. In ecs-agent's log, it shows up like: > level=error time=2022-09-19T22:30:56Z msg="Failed to create task resource" error="fetching secret data from SSM Parameter Store in us-west-2: RequestError: send request failed\ncaused by: Post \"https://ssm.us-west-2.amazonaws.com/\": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)" task="..." resource="ssmsecret" > level=info time=2022-09-19T22:30:56Z msg="Setting terminal reason for task" reason="fetching secret data from SSM Parameter Store in us-west-2: Request Error: send request failed\ncaused by: Post \"https://ssm.us-west-2.amazonaws.com/\": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)" task="..." We tried increasing the throughput of SSM Parameter Store through its settings, but it didn't seem to have an effect. https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-throughput.html Other guides and Q&As I could find were about network misconfigurations that would lead to a complete inability to talk to SSM, whereas the symptom I'm seeing is only intermittent; the ECS tasks get launched without an issue most of the time. https://aws.amazon.com/premiumsupport/knowledge-center/ssm-tcp-timeout-error/ What could be the cause? What else can I look into?
0
answers
0
votes
25
views
asked 2 months ago

AWS CodePipeline throwing error "Missing required parameter in pipeline.stages[0]: "name""

I am trying to create a CICD of my application that is available on Bitbucket. For this, I have created AWS CodePipeline that will deploy this app to ECS Cluster. I am trying to do this via AWS CLI. Here is my JSON file: ``` { "pipeline": { "roleArn": "arn:aws:iam::xxxxxxxxxxxx:role/service-role/AWSCodePipelineServiceRole-us-east-1-HubspotConnector", "stages": [{ "Name": "Source", "Actions": [{ "InputArtifacts": [], "ActionTypeId": { "Version": "1", "Owner": "AWS", "Category": "Source", "Provider": " " }, "OutputArtifacts": [{ "Name": "SourceArtifact" }], "RunOrder": 1, "Configuration": { "ConnectionArn": "arn:aws:codestar-connections:us-east-1:7xxxxxxxx3930:connection/5bxxxx2-257f-4xxxxx0-xxx3-edfdsfsdf7d672f", "FullRepositoryId": "rxxxxxh/hubspotcctorpipeline", "BranchName": "main", "OutputArtifactFormat": "CODE_ZIP" }, "Name": "ApplicationSource" }] }, { "name": "Build", "actions": [{ "inputArtifacts": [{ "name": "SourceArtifact" }], "name": "Build", "actionTypeId": { "category": "Build", "owner": "AWS", "version": "1", "provider": "CodeBuild" }, "outputArtifacts": [{ "name": "default" }], "Configuration": { "ProjectName": "cicdCli" }, "runOrder": 1 }] }, { "Name": "DeployECS", "ActionTypeId": { "Category": "Deploy", "Owner": "AWS", "Provider": "ECS", "Version": "1" }, "RunOrder": 2, "Configuration": { "ClusterName": "my-ecs-cluster", "ServiceName": "sample-app-service", "FileName": "imagedefinitions.json", "DeploymentTimeout": "15" }, "OutputArtifacts": [], "InputArtifacts": [{ "Name": "my-image" }] } ], "artifactStore": { "type": "S3", "location": "codepipeline-us-east-1-1xxx5xxxx29" }, "name": "newPipelineCicd", "version": 1 } } ``` Here is the error I am facing: ![Error](/media/postImages/original/IMevKWkplzTF6rf1ySM-KXmg) Can Someone describe me what I am doing wrong? I have searched for these errors but didn't get any help from anywhere. Also no one have written any tutorial or proper guide for this. I have found AWS documentation, one of the complexest documentations. Please guide me here.I would really appreciate that.
1
answers
0
votes
60
views
asked 3 months ago

Aws CodePipeline to Deploy to ECS Cluster using AWS CLI

I am using AWS CodePipeline to create a CICD. I am using Bitbucket as a source, using CodeBuid and Amazon CodePipeline. I have done this using console but now I want to create CodePipeline using AWS CLI. For this, we have to create a JSON file that holds the configuration. I want to deploy my application to ECS but I don't find any JSON format to do this. Here you can see the JSON file: ``` { "pipeline": { "roleArn": "arn:aws:iam::74555555530:role/service-role/AWSCodePipelineServiceRole-us-east-1-HubspotConnector", "stages": [ { "Name": "Source", "Actions": [ { "InputArtifacts": [], "ActionTypeId": { "Version": "1", "Owner": "AWS", "Category": "Source", "Provider": "CodeStarSourceConnection" }, "OutputArtifacts": [ { "Name": "SourceArtifact" } ], "RunOrder": 1, "Configuration": { "ConnectionArn": "arn:aws:codestar-connections:us-east-1:747926693930:connection/5b2xxxx2-2xxf-4xx0-9xx3-xxcfxxxxx72f", "FullRepositoryId": "an-c/rpipeline", "BranchName": "xxxxxx", "OutputArtifactFormat": "CODE_ZIP" }, "Name": "ApplicationSource" } ] }, { "name": "Build", "actions": [ { "inputArtifacts": [ { "name": "SourceArtifact" } ], "name": "Build", "actionTypeId": { "category": "Build", "owner": "AWS", "version": "1", "provider": "CodeBuild" }, "outputArtifacts": [ { "name": "default" } ], "configuration": { "ProjectName": "cicdCli" }, "runOrder": 1 } ] } ], "artifactStore": { "type": "S3", "location": "codepipeline-us-east-1-16896969692329" }, "name": "newPipelineCicd", "version": 1 } } ``` It has source stage, build stage but I don't know how to write build stage (for Deploy to ECS). Can someone guide me what are the exact parameters for build stage (ECS deployment).
1
answers
0
votes
76
views
asked 3 months ago