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

ec2:ResolveSsmParameterAtLaunchImage): error on deploy. #28090

Closed
mrpackethead opened this issue Nov 21, 2023 · 2 comments · Fixed by #28110
Closed

ec2:ResolveSsmParameterAtLaunchImage): error on deploy. #28090

mrpackethead opened this issue Nov 21, 2023 · 2 comments · Fixed by #28110
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud bug This issue is a bug. effort/small Small work item – less than a day of effort p2

Comments

@mrpackethead
Copy link

Describe the bug

I'm passing the name of a ssm parameter to REsolveSSMParamterAtLaunchImage, as the machineimage for an ASG. Its failing with this error and deploy time.

7:20:02 AM | CREATE_FAILED | AWS::AutoScaling::LaunchConfiguration | portalASGLaunchConf
ig16E327B6
Resource handler returned message: "AMI resolve:ssm:portalAMI is invalid: Invalid id: "resolve:
ssm:portalAMI" (expecting "ami-...") (Service: AutoScaling, Status Code: 400, Request ID: 0c8bf
885-13df-4156-b85b-2d9eb1c2c5c6)" (RequestToken: a94bb337-b183-2a4d-4b08-745839d5b9da, HandlerE
rrorCode: InvalidRequest)

// create an application scaling group for portal service
    this.portal = new autoscaling.AutoScalingGroup(scope, 'portalASG', {
      vpc: props.vpc,
      allowAllOutbound: false,
      associatePublicIpAddress: false,
      autoScalingGroupName: 'portal',
      cooldown: core.Duration.minutes(5),
      defaultInstanceWarmup: core.Duration.seconds(60),
      minCapacity: 2,
      maxCapacity: 5,
      maxInstanceLifetime: core.Duration.days(7),
      groupMetrics: [autoscaling.GroupMetrics.all()],
      instanceType: ec2.InstanceType.of(ec2.InstanceClass.MEMORY5, ec2.InstanceSize.XLARGE2),
      machineImage: new ec2.ResolveSsmParameterAtLaunchImage(
        props.portalAMIssm,
        {
          cachedInContext: false,
          os: ec2.OperatingSystemType.LINUX,
          // userData:
        },
      ),
      requireImdsv2: true,
      ssmSessionPermissions: true,
      vpcSubnets: { subnetGroupName: 'portal' },
    });

Expected Behavior

for it to resolve the ami value

Current Behavior

its not resolving.

Reproduction Steps

see code above

Possible Solution

not sure.

Additional Information/Context

No response

CDK CLI Version

2.105.0

Framework Version

No response

Node.js Version

20

OS

linux

Language

TypeScript

Language Version

No response

Other information

No response

@mrpackethead mrpackethead added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 21, 2023
@github-actions github-actions bot added the @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud label Nov 21, 2023
@pahud
Copy link
Contributor

pahud commented Nov 22, 2023

Looks like your ASG is using launch configuration but this feature only supports launch template.

https://docs.aws.amazon.com/autoscaling/ec2/userguide/using-systems-manager-parameters.html

@pahud pahud added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. p2 and removed needs-triage This issue or PR still needs to be triaged. labels Nov 22, 2023
@pahud pahud added effort/small Small work item – less than a day of effort and removed response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Nov 22, 2023
@mergify mergify bot closed this as completed in #28110 Nov 22, 2023
mergify bot pushed a commit that referenced this issue Nov 22, 2023
Improve the doc to clarify its limit.

Closes #28090

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud bug This issue is a bug. effort/small Small work item – less than a day of effort p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants