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

EKS: No AMI for Kubernetes 1.13 or Unable to determine AMI from AMI map since stack is region-agnostic #3120

Closed
1 of 5 tasks
lkoniecz opened this issue Jun 28, 2019 · 3 comments · Fixed by #3137
Closed
1 of 5 tasks
Labels
needs-triage This issue or PR still needs to be triaged.

Comments

@lkoniecz
Copy link

lkoniecz commented Jun 28, 2019

Note: for support questions, please first reference our documentation, then use Stackoverflow. This repository's issues are intended for feature requests and bug reports.

  • I'm submitting a ...

    • 🪲 bug report
    • 🚀 feature request
    • 📚 construct library gap
    • ☎️ security issue or vulnerability => Please see policy
    • ❓ support request => Please see note at the top of this template.
  • What is the current behavior?
    If the current behavior is a 🪲bug🪲: Please provide the steps to reproduce

vpc = aws_ec2.Vpc(scope=self, id='VpcCustomEnv', cidr='192.168.0.0/16')
eks_cluster = aws_eks.Cluster(scope=self, id='EksCluster', vpc=vpc)
eks_cluster.add_capacity(id='capacity', instance_type='t2.large'desired_capacity=1)

exits with jsii.errors.JSIIError: Unable to determine AMI from AMI map since stack is region-agnostic

if you add a version to EKS, say
eks_cluster = aws_eks.Cluster(scope=self, id='EksCluster', vpc=vpc, version='1.13')

exits with jsii.errors.JSIIError: We don't have an AMI for kubernetes version 1.12

  • What is the expected behavior (or behavior of feature suggested)?
    Program compiles and outputs a valid template

  • What is the motivation / use case for changing the behavior or adding this feature?
    Whole EKS service is completely disabled in 0.36

  • Please tell us about your environment:

    • CDK CLI Version: 0.36.0 (build 6d38487)
    • Module Version: 0.36.0
    • OS: [Ubuntu 19.4 ]
    • Language: [ Python ]
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc)

@lkoniecz lkoniecz added the needs-triage This issue or PR still needs to be triaged. label Jun 28, 2019
@lkoniecz
Copy link
Author

lkoniecz commented Jun 28, 2019

Related to #2922.

Found a solution, pass region thru env variable
DevelopmentStack(app=app, id='Dev', env={'region': 'eu-west-1'})

Overload the super constructor call with
super().__init__(app, id, **kwargs)

@eladb
Copy link
Contributor

eladb commented Jun 30, 2019

You can also use the CDK_DEFAULT_REGION and CDK_DEFAULT_ACCOUNT to associate the stack with the CLI's env:

DeploymentStack(
  app=app, 
  id='Dev', 
  env={
    'account': os.environ['CDK_DEFAULT_ACCOUNT'], 
    'region': os.environ['CDK_DEFAULT_REGION']
  }
)

@eladb eladb closed this as completed Jun 30, 2019
@eladb eladb reopened this Jun 30, 2019
eladb pushed a commit that referenced this issue Jun 30, 2019
…tacks

Following up on #2922: improve the error message emitted when trying to read context from an environment-agnostic stack by calling out CDK_DEFAULT_ACCOUNT and CDK_DEFAULT_REGION as a way to inherit environment information from the CLI.

Fixes #3078 
Fixes #3120 
Fixes #3130
eladb pushed a commit that referenced this issue Jul 1, 2019
…tacks (#3137)

Following up on #2922: improve the error message emitted when trying to read context from an environment-agnostic stack by calling out CDK_DEFAULT_ACCOUNT and CDK_DEFAULT_REGION as a way to inherit environment information from the CLI.

Fixes #3078
Fixes #3120
Fixes #3130
@cc4i
Copy link

cc4i commented Sep 9, 2019

It sounds like, 'CDK_DEFAULT_REGION' depends on 'AWS_DEFAULT_REGION'. For example,

const stack = new GoEksStack(app, 'GoEksStack', {
env: {
account: process.env.CDK_DEFAULT_ACCOUNT,
region: process.env.CDK_DEFAULT_REGION
},
stackName: process.env.STACK_NAME
});

If I neither config credential or AWS_DEFAULT_REGION, run "cdk synth", then showed "Unable to determine AMI from AMI map since stack is region-agnostic" . It'll be fixed once set up 'AWS_DEFAULT_REGION'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants