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

❗ NOTICE(ec2): new WindowsVersion enum values used in WindowsImage() gives: Deployment failed: Error [ValidationError]: Unable to fetch parameters [/aws/service/ami-windows-latest/Windows_Server-<Specific-Image>-<YYYY.MM.DD>] from parameter store for this account. #29736

Closed
scanlonp opened this issue Apr 5, 2024 · 3 comments Β· Fixed by #29737 Β· 4 remaining pull requests
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud bug This issue is a bug. management/tracking Issues that track a subject or multiple issues p0

Comments

@scanlonp
Copy link
Contributor

scanlonp commented Apr 5, 2024

Please add your +1 πŸ‘ to let us know you have encountered this

Status: IN-PROGRESS

Overview:

Present in v2.135.0-v2.136.0

The only impact to existing applications is a deprecation notice. You can safely ignore this.

#29435 updated the windows versions enums. The new enums suffixed with dates (i.e. WINDOWS_SERVER_2022_ENGLISH_FULL_BASE_2024_02_14) are not found when used in constructs that extend GenericSSMParameterImage. The working enums were mistakenly deprecated (i.e. WINDOWS_SERVER_2022_ENGLISH_FULL_BASE).

const ami = new ec2.WindowsImage(ec2.WindowsVersion.WINDOWS_SERVER_2022_ENGLISH_FULL_BASE_2024_02_14);

const instance = new ec2.Instance(this, "WindowsInstance", {
  vpc: new ec2.Vpc(this, "WindowsVPC"),
  instanceType: ec2.InstanceType.of(ec2.InstanceClass.T2, ec2.InstanceSize.MICRO),
  machineImage: ami,
});

When deployed gives the following error.

Complete Error Message: Deployment failed: Error [ValidationError]: Unable to fetch parameters [/aws/service/ami-windows-latest/Windows_Server-2022-English-Full-Base-1.28-2024.02.13] from parameter store for this account.

Workaround:

Continue to use the wrongly deprecated enum values that are not suffixed with dates.

Solution:

We issue has been reverted and the fix is in place as of v2.136.1.

@nmussy
Copy link
Contributor

nmussy commented Apr 5, 2024

I'll have a look, thanks for letting me know πŸ‘

@nmussy
Copy link
Contributor

nmussy commented Apr 5, 2024

Yeah, didn't see that issue, sorry about that. I think keeping the datestamped, non-generic versions around would be best, given the replacement issues with latestWindows. Splitting the WindowsVersion enum and adding a MachineImage method is probably the solution here:

new ec2.Instance(this, 'WindowsLatestLookup', {
  instanceType,
  machineImage: ec2.MachineImage.latestWindows(
    ec2.WindowsVersion.WINDOWS_SERVER_2022_ENGLISH_FULL_BASE,
  ),
  vpc,
});

new ec2.Instance(this, 'WindowsSpecificVersion', {
  instanceType,
  machineImage: ec2.MachineImage.specificWindows(
    ec2.WindowsSpecificVersion.WINDOWS_SERVER_2022_ENGLISH_FULL_BASE_2024_02_14,
  ),
  vpc,
});

latestWindows would keep using the /aws/service/ami-windows-latest/ SSM parameter query, and specificWindows would use ecr:DescribeImages with MachineImage.lookup

Should have a fix ready in the next few hours

@scanlonp scanlonp changed the title ec2: WindowsVersions enum values broken NOTICE(ec2): new WindowsVersions enum values used in WindowsImage() gives: Deployment failed: Error [ValidationError]: Unable to fetch parameters [/aws/service/ami-windows-latest/Windows_Server-<Specific-Image>-<YYYY.MM.DD>] from parameter store for this account. Apr 9, 2024
@scanlonp scanlonp changed the title NOTICE(ec2): new WindowsVersions enum values used in WindowsImage() gives: Deployment failed: Error [ValidationError]: Unable to fetch parameters [/aws/service/ami-windows-latest/Windows_Server-<Specific-Image>-<YYYY.MM.DD>] from parameter store for this account. ❗ NOTICE(ec2): new WindowsVersions enum values used in WindowsImage() gives: Deployment failed: Error [ValidationError]: Unable to fetch parameters [/aws/service/ami-windows-latest/Windows_Server-<Specific-Image>-<YYYY.MM.DD>] from parameter store for this account. Apr 9, 2024
@scanlonp scanlonp added p0 management/tracking Issues that track a subject or multiple issues @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud and removed p1 labels Apr 9, 2024
@scanlonp scanlonp pinned this issue Apr 9, 2024
@mergify mergify bot closed this as completed in #29737 Apr 9, 2024
mergify bot pushed a commit that referenced this issue Apr 9, 2024
Copy link

github-actions bot commented Apr 9, 2024

⚠️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.

@scanlonp scanlonp changed the title ❗ NOTICE(ec2): new WindowsVersions enum values used in WindowsImage() gives: Deployment failed: Error [ValidationError]: Unable to fetch parameters [/aws/service/ami-windows-latest/Windows_Server-<Specific-Image>-<YYYY.MM.DD>] from parameter store for this account. ❗ NOTICE(ec2): new WindowsVersion enum values used in WindowsImage() gives: Deployment failed: Error [ValidationError]: Unable to fetch parameters [/aws/service/ami-windows-latest/Windows_Server-<Specific-Image>-<YYYY.MM.DD>] from parameter store for this account. Apr 9, 2024
scanlonp added a commit that referenced this issue Apr 9, 2024
@piradeepk piradeepk unpinned this issue Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment