Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ecs: help with importing cross account cluster #26076

Closed
2 tasks
katzj-amzn opened this issue Jun 21, 2023 · 2 comments
Closed
2 tasks

ecs: help with importing cross account cluster #26076

katzj-amzn opened this issue Jun 21, 2023 · 2 comments
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. feature-request A feature should be added or improved. p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@katzj-amzn
Copy link

Describe the feature

I am trying to call a Fargate task definition from a SFN in account A to a cluster in account B. This is done in our CDK package.

I am getting connections is not available for a Cluster imported using fromClusterArn(), please use fromClusterAttributes() instead when trying to reference a Fargate cluster defined in a separate account.

Using CDK I have:

    const ecsRunTaskProps: EcsRunTaskProps = {
      taskDefinition: taskDefinition,
      cluster: Cluster.fromClusterArn(scope, 'ExcelDataExportFargateCluster', clusterARN),
      // cluster: Cluster.fromClusterAttributes(scope, 'ClusterAttributes', clusterAttributes),
      launchTarget: new EcsFargateLaunchTarget(),
      resultPath: '$.taskresult'
    };

    return new EcsRunTask(scope, `ExcelDataExportTask`, ecsRunTaskProps);

This produces the error. The issue with using ClusterAttributes is it does not have a field for AccountId, and requires VPC field which also does not have a field for accountId.

Use Case

Cross account calls to ECSRunTask

Proposed Solution

Allow fromClusterArn to work for cross account requests, or provide another way to make cross account requests.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

1

Environment details (OS name and version, etc.)

macOS 13.4 (22F66)

@katzj-amzn katzj-amzn added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jun 21, 2023
@github-actions github-actions bot added the @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud label Jun 21, 2023
@peterwoodworth
Copy link
Contributor

The issue with using ClusterAttributes is it does not have a field for AccountId, and requires VPC field which also does not have a field for accountId.

These shouldn't need an accountId field, just try using fromClusterAttributes() while supplying the arn and any other necessary information.

@peterwoodworth peterwoodworth added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. p2 and removed needs-triage This issue or PR still needs to be triaged. labels Jun 21, 2023
@peterwoodworth peterwoodworth changed the title (module name): (short issue description) ecs: help with importing cross account cluster Jun 21, 2023
@github-actions
Copy link

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Jun 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. feature-request A feature should be added or improved. p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants