1
votes

I'm trying to follow the official tutorial: https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html

I picked Java but tried Typescript too with the same result: the S3 bucket resource template isn't produced and the deploy doesn't create the bucket.

The code is here: https://github.com/jumarko/aws-experiments/tree/master/cdk/hello-cdk-java

The cdk synth command produces only this CDKMetadata and nothing else:

cd hello-cdk-java

cdk init app --language java

mvn compile

cdk ls

# modify the stack java code
...

# this for some reason only outputs Metadata for me
# even `mvn clean package` doesn't help
cdk synth
Resources:
  CDKMetadata:
    Type: AWS::CDK::Metadata
    Properties:
      Modules: aws-cdk=1.61.1,@aws-cdk/cloud-assembly-schema=1.61.1,@aws-cdk/core=1.61.1,@aws-cdk/cx-api=1.61.1,jsii-runtime=Java/14.0.1
    Condition: CDKMetadataAvailable
Conditions:
  CDKMetadataAvailable:
    Fn::Or:
      - Fn::Or:
          - Fn::Equals:
              - Ref: AWS::Region
              - ap-east-1
          - Fn::Equals:
              - Ref: AWS::Region
              - ap-northeast-1
          - Fn::Equals:
              - Ref: AWS::Region
              - ap-northeast-2
          - Fn::Equals:
              - Ref: AWS::Region
              - ap-south-1
          - Fn::Equals:
              - Ref: AWS::Region
              - ap-southeast-1
          - Fn::Equals:
              - Ref: AWS::Region
              - ap-southeast-2
          - Fn::Equals:
              - Ref: AWS::Region
              - ca-central-1
          - Fn::Equals:
              - Ref: AWS::Region
              - cn-north-1
          - Fn::Equals:
              - Ref: AWS::Region
              - cn-northwest-1
          - Fn::Equals:
              - Ref: AWS::Region
              - eu-central-1
      - Fn::Or:
          - Fn::Equals:
              - Ref: AWS::Region
              - eu-north-1
          - Fn::Equals:
              - Ref: AWS::Region
              - eu-west-1
          - Fn::Equals:
              - Ref: AWS::Region
              - eu-west-2
          - Fn::Equals:
              - Ref: AWS::Region
              - eu-west-3
          - Fn::Equals:
              - Ref: AWS::Region
              - me-south-1
          - Fn::Equals:
              - Ref: AWS::Region
              - sa-east-1
          - Fn::Equals:
              - Ref: AWS::Region
              - us-east-1
          - Fn::Equals:
              - Ref: AWS::Region
              - us-east-2
          - Fn::Equals:
              - Ref: AWS::Region
              - us-west-1
          - Fn::Equals:
              - Ref: AWS::Region
              - us-west-2


Any clue on what's going on or how to debug the issue?

I'm using Mac OS X 10.15.6 with the following CLI versions:

$ aws --version
aws-cli/2.0.10 Python/3.8.2 Darwin/19.6.0 botocore/2.0.0dev14

$ cdk --version
1.61.1 (build 347918f)

1

1 Answers

1
votes

I generated a new project from the template and it suddenly started to work. I'm not sure what changed - I also experimented with using different --profile but at first that didn't work either.

The issue is solved now - if something goes wrong it's worth starting from scratch again!