Skip to content

Commit

Permalink
chore: rollback GenericSSMParameterImage deprecation (#16798)
Browse files Browse the repository at this point in the history
This class was deprecated because it should not have been used directly:

- It is used more as a base class for other images
- It should be accessed through factory functions on `MachineImage`.
- It has an uppercased acronym `SSM`, which should have been spelled as
  `Ssm`.

The deprecated API stripper does the wrong thing when a base class is
deprecated however, and leaves `WindowsImage` in a broken state. See
aws/jsii#3025

Temporarily rolling this back until we can fix jsii.

----

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

(cherry picked from commit 5dfc507)
  • Loading branch information
rix0rrr authored and mergify-bot committed Oct 5, 2021
1 parent b6d098e commit 25249dd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/@aws-cdk/aws-ec2/lib/machine-image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,12 @@ export interface MachineImageConfig {
* on the instance if you are using this image.
*
* The AMI ID is selected using the values published to the SSM parameter store.
*
* @deprecated Use `MachineImage.fromSsmParameter()` instead
*/
export class GenericSSMParameterImage implements IMachineImage {
// FIXME: this class ought to be `@deprecated` and removed from v2, but that
// is causing build failure right now. Ref: https://github.com/aws/jsii/issues/3025
// @-deprecated Use `MachineImage.fromSsmParameter()` instead

/**
* Name of the SSM parameter we're looking up
*/
Expand Down Expand Up @@ -679,4 +681,4 @@ function lookupImage(scope: Construct, cachedInContext: boolean | undefined, par
return cachedInContext
? ssm.StringParameter.valueFromLookup(scope, parameterName)
: ssm.StringParameter.valueForTypedStringParameter(scope, parameterName, ssm.ParameterType.AWS_EC2_IMAGE_ID);
}
}

0 comments on commit 25249dd

Please sign in to comment.