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

https://github.com/aws-samples/aws-cdk-examples/tree/master/java/static-site is not working #751

Open
nagkumar opened this issue Sep 27, 2022 · 1 comment
Labels
bug This issue is a bug. language/java Related to Java examples p1

Comments

@nagkumar
Copy link

Describe the bug

env variables are correct, but still gives error

Expected Behavior

this example should work locally

Current Behavior

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.1.0:java (default-cli) on project static-site: An exception occurred while executing the Java class. Error: Cannot retrieve value from context provider hosted-zone since account/region are not specified at the stack level. Configure "env" with an account and region when you define your stack.See https://docs.aws.amazon.com/cdk/latest/guide/environments.html for more details.
[ERROR] @jsii/kernel.RuntimeError: Error: Cannot retrieve value from context provider hosted-zone since account/region are not specified at the stack level. Configure "env" with an account and region when you define your stack.See https://docs.aws.amazon.com/cdk/latest/guide/environments.html for more details.
[ERROR] at Kernel._ensureSync (C:\Users\RAJANA1\AppData\Local\Temp\jsii-java-runtime14064205540975823778\lib\program.js:7889:27)
[ERROR] at Kernel.sinvoke (C:\Users\RAJANA
1\AppData\Local\Temp\jsii-java-runtime14064205540975823778\lib\program.js:7325:34)
[ERROR] at KernelHost.processRequest (C:\Users\RAJANA1\AppData\Local\Temp\jsii-java-runtime14064205540975823778\lib\program.js:10466:36)
[ERROR] at KernelHost.run (C:\Users\RAJANA
1\AppData\Local\Temp\jsii-java-runtime14064205540975823778\lib\program.js:10429:22)
[ERROR] at Immediate._onImmediate (C:\Users\RAJANA~1\AppData\Local\Temp\jsii-java-runtime14064205540975823778\lib\program.js:10430:46)
[ERROR] at process.processImmediate (node:internal/timers:471:21)

Reproduction Steps

cdk ls

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.43.1 (build c1ebb85)

Framework Version

No response

Node.js Version

nod 18

OS

win 10

Language

Java

Language Version

18

@nagkumar nagkumar added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 27, 2022
@nagkumar nagkumar changed the title https://github.com/aws-samples/aws-cdk-examples/tree/master/java/static-site does not work https://github.com/aws-samples/aws-cdk-examples/tree/master/java/static-site is not working Sep 27, 2022
@liyanone
Copy link

Able to reproduce the issue by running below commands
mvn compile
cdk ls
cdk bootstrap
cdk deploy -c domain=mystaticsite.com -c subdomain=www --all

Actually, this is considered an warning which only occurs when running cdk synth/deploy/destroy. It DOES NOT block the cdk process as there are default region/account values set in example code or local aws configure.

As suggested in the warning log itself as well as in another issue (#238), follow this guide (https://docs.aws.amazon.com/cdk/v2/guide/environments.html) to set the account and region env in your code.

@kaiz-io kaiz-io added language/java Related to Java examples p1 and removed needs-triage This issue or PR still needs to be triaged. labels Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. language/java Related to Java examples p1
Projects
None yet
Development

No branches or pull requests

3 participants