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

awsroute53: New record A uses lambda Node 14 #32629

Open
1 task
joaovitorteixeira opened this issue Dec 22, 2024 · 1 comment
Open
1 task

awsroute53: New record A uses lambda Node 14 #32629

joaovitorteixeira opened this issue Dec 22, 2024 · 1 comment
Labels
@aws-cdk/aws-route53 Related to Amazon Route 53 bug This issue is a bug. p3 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@joaovitorteixeira
Copy link

joaovitorteixeira commented Dec 22, 2024

Describe the bug

I'm trying to create a custom domain for my cognito user pool. This is my code:

userPoolDomain := userPool.AddDomain(jsii.String("MoonenvCognitoDomain"), &awscognito.UserPoolDomainOptions{
	CustomDomain: &awscognito.CustomDomainOptions{
		DomainName:  props.AuthSubdomain,
		Certificate: props.CdkRoute53StackResource.UsEast1Certificate,
	},
})


awsroute53.NewARecord(stack, jsii.String("MoonenvUserPoolARecord"), &awsroute53.ARecordProps{
	Zone:       props.CdkRoute53StackResource.IHostedZone,
	RecordName: props.AuthSubdomain,
	Target:     awsroute53.AddressRecordTarget_FromAlias(awsroute53targets.NewUserPoolDomainTarget(userPoolDomain)),
})

When I deploy it, I get this error: The runtime parameter of nodejs14.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use a supported runtime while creating or updating functions.

This is the created template:

  "AWS679f53fac002430cb0da5b7982bd22872D164C4C": {
   "Type": "AWS::Lambda::Function",
   "Properties": {
    "Code": {
     "S3Bucket": {
      "Ref": "AssetParameters105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286S3BucketC526447A"
     },
     "S3Key": {
      "Fn::Join": [
       "",
       [
        {
         "Fn::Select": [
          0,
          {
           "Fn::Split": [
            "||",
            {
             "Ref": "AssetParameters105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286S3VersionKey237620B5"
            }
           ]
          }
         ]
        },
        {
         "Fn::Select": [
          1,
          {
           "Fn::Split": [
            "||",
            {
             "Ref": "AssetParameters105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286S3VersionKey237620B5"
            }
           ]
          }
         ]
        }
       ]
      ]
     }
    },
    "Role": {
     "Fn::GetAtt": [
      "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2",
      "Arn"
     ]
    },
    "Handler": "index.handler",
    "Runtime": "nodejs14.x",
    "Timeout": 120
   },
   "DependsOn": [
    "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2"
   ],
   "Metadata": {
    "aws:cdk:path": "MoonenvCognitoStack/AWS679f53fac002430cb0da5b7982bd2287/Resource",
    "aws:asset:path": "asset.105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286",
    "aws:asset:is-bundled": false,
    "aws:asset:property": "Code"
   }
  },

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

I imagine it should try to execute on the LTS version, which is 20

Current Behavior

It's trying to use version 14

Reproduction Steps

Create a stack that creates a cognito with a user pool, then try to attach a custom domain (using the example i gave), and finally creates a record o route 53 using NewUserPoolDomainTarget as alias.

Possible Solution

No response

Additional Information/Context

I'm working on it in my public repository on refator/infra-as-code branch in case you want to have more context.
https://github.com/PBH-Tech/moonenv

CDK CLI Version

2.173.2

Framework Version

No response

Node.js Version

v20.10.0

OS

Sequoia Version 15.0.1

Language

Go

Language Version

go1.22.2

Other information

No response

@joaovitorteixeira joaovitorteixeira added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 22, 2024
@github-actions github-actions bot added the @aws-cdk/aws-route53 Related to Amazon Route 53 label Dec 22, 2024
@pahud pahud self-assigned this Dec 23, 2024
@pahud
Copy link
Contributor

pahud commented Dec 23, 2024

Looks like you are still using v1.204?

https://github.com/PBH-Tech/moonenv/blob/619501d58bc514bf9d026ced2c6859fd67d30ae7/server/go.mod#L41C2-L41C27

You need to make sure your awscdk is using v2 and we recommend the latest CDK release.

check https://docs.aws.amazon.com/cdk/v2/guide/work-with-cdk-go.html#go-prerequisites for more details.

@pahud pahud added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. p3 labels Dec 23, 2024
@pahud pahud removed their assignment Dec 23, 2024
@pahud pahud removed the needs-triage This issue or PR still needs to be triaged. label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-route53 Related to Amazon Route 53 bug This issue is a bug. p3 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