question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[aws-ecs][aws-codepipeline-actions][aws-codepipeline]: ecs.FargateService.fromFargateServiceArn

See original GitHub issue

I’m trying to create a pipeline with a deploy step that should deploy from the pipeline account to another account.

Unfortunately I’m not able to get it running.

    private getEcsFargateService(stage: string): ecs.IFargateService {
        const props = this.node.tryGetContext(stage); // needed to figure out which account and region is used
        const clusterName = 'myCluster';
        const ecsServiceName = 'myService';
        const fargateServiceArn = `arn:aws:ecs:${props.region}:${props.account}:service/${clusterName}/${ecsServiceName}`;
        const fargateService = ecs.FargateService.fromFargateServiceArn(this.stack, `MLEcsFargateService-${stage}`, fargateServiceArn);
        return fargateService;
    }

    private getDeployToDevStage(): codepipeline.StageProps {
        return {
            stageName: 'Deploy-Dev',
            actions: [
                new codepipelineActions.EcsDeployAction({
                    actionName: 'Deploy-Dev',
                    input: buildDeployImageOutput,
                    service: this.getEcsFargateService('dev')
                })
            ]
        }
    }

In this line service: this.getEcsFargateService('dev') I’m getting the error: Property 'cluster' is missing in type 'IFargateService' but required in type 'IBaseService'

I think the account, region and cluster name should already be defined in the arn, isn’t it?

Reproduction Steps

just try out the code written above

What did you expect to happen?

I would expect that the IFargateService could be used in the CodePipeline action.

What actually happened?

Error occured: Property 'cluster' is missing in type 'IFargateService' but required in type 'IBaseService'

Environment

  • CDK CLI Version : 1.77.0
  • **Framework Version: ** 1.77.0
  • Node.js Version: I guess the one used by codebuild.LinuxBuildImage.STANDARD_4_0
  • OS : codebuild.LinuxBuildImage.STANDARD_4_0
  • Language (Version):

Other


This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
joa44741commented, Dec 17, 2020

Yes that worked! 😃 thank you very much!

0reactions
github-actions[bot]commented, Dec 17, 2020

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ecs.FargateService - AWS Documentation - Amazon.com
No information is available for this page.
Read more >
awsx.ecs.FargateService - Pulumi
Documentation for the awsx.ecs.FargateService resource with examples, input properties, output properties, lookup functions, and supporting types.
Read more >
AWS CDK EcsDeployAction update existing Fargate Service
Pipeline(this, 'MyPipeline') // import an existing fargate service const fargateService = ecs.FargateService.fromFargateServiceArn( this, " ...
Read more >
Deploy ECS Fargate service - Snyk User Docs
In the following set of commands we are going to use CloudFormation to deploy services that will allow our Unicorn Store application to...
Read more >
In what way does a new ECS Fargate service not satisfy the ...
When creating a new AWS ECS service using a Fargate task, in the AWS Console wizard, it fails with the following error:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found