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

(@aws-cdk/aws-ecs): unable to add data volumes to a task definition #12157

Closed
wistonk opened this issue Dec 18, 2020 · 2 comments
Closed

(@aws-cdk/aws-ecs): unable to add data volumes to a task definition #12157

wistonk opened this issue Dec 18, 2020 · 2 comments
Labels
@aws-cdk/aws-ecs Related to Amazon Elastic Container bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. documentation This is a problem with documentation. effort/small Small work item – less than a day of effort needs-reproduction This issue needs reproduction. p2

Comments

@wistonk
Copy link

wistonk commented Dec 18, 2020

Getting below errors when adding a volume on a task definition using @aws-cdk/aws-ecs module.

- Volume' does not exist on type 'typeof import...
- Property 'EfsVolumeConfiguration' does not exist ...

Reproduction Steps

  • Create a task definition and add a volume
const volume = ecs.Volume("Volume", {
  // Use an Elastic FileSystem
  name: "mydatavolume",
  efsVolumeConfiguration: ecs.EfsVolumeConfiguration({
    fileSystemId: "EFS"
    // ... other options here ...
  })
});

const container = fargateTaskDefinition.addVolume("mydatavolume");

What did you expect to happen?

Successfully add data volumes to a task definition without above stated error

What actually happened?

error TS2339: Property 'Volume' does not exist on type 'typeof import("/Users/me/../../myproject/node_modules/@aws-cdk/aws-ecs/lib/index")'.

and

error TS2339: Property 'EfsVolumeConfiguration' does not exist on type 'typeof import("/Users/me/../../myproject/node_modules/@aws-cdk/aws-ecs/lib/index")'.

Environment

  • **CDK CLI Version : 1.79.0 (build 8b3bf9c)
  • Framework Version:
  • **Node.js Version: v14.4.0
  • **OS :macOs Catalina
  • **Language (Version):TypeScript (3.8.3)

This is 🐛 Bug Report

@wistonk wistonk added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 18, 2020
@SomayaB SomayaB added the @aws-cdk/aws-ecs Related to Amazon Elastic Container label Dec 18, 2020
@SoManyHs SoManyHs added needs-reproduction This issue needs reproduction. p2 and removed needs-triage This issue or PR still needs to be triaged. labels Dec 23, 2020
@whilp
Copy link

whilp commented Dec 23, 2020

Ran into this, too. It seems like Volume was only added as an interface in #8467. There, the documentation disagrees with the test:

const volume = ecs.Volume("Volume", {
// Use an Elastic FileSystem
name: "mydatavolume",
efsVolumeConfiguration: ecs.EfsVolumeConfiguration({
fileSystemId: "EFS"
// ... other options here ...
})
});
const container = fargateTaskDefinition.addVolume("mydatavolume");

const volume = {
name: 'scratch',
efsVolumeConfiguration: {
fileSystemId: 'local',
},
};

I can at least proceed to compile (TypeScript) using the approach evident in the tests.

@MrArnoldPalmer MrArnoldPalmer added documentation This is a problem with documentation. effort/small Small work item – less than a day of effort labels Feb 22, 2021
@github-actions
Copy link

This issue has not received any attention in 1 year. 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 May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ecs Related to Amazon Elastic Container bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. documentation This is a problem with documentation. effort/small Small work item – less than a day of effort needs-reproduction This issue needs reproduction. p2
Projects
None yet
Development

No branches or pull requests

6 participants