# GenericSSMParameterImage

Select the image based on a given SSM parameter at deployment time of the CloudFormation Stack.

This Machine Image automatically updates to the latest version on every
deployment. Be aware this will cause your instances to be replaced when a
new version of the image becomes available. Do not store stateful information
on the instance if you are using this image.

The AMI ID is selected using the values published to the SSM parameter store.

Extends: GenericSSMParameterImage
Implements: IMachineImage
Superclass of: AmazonLinuxImage, WindowsImage

- Source: [`aws-ec2/lib/machine-image/machine-image.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-ec2/lib/machine-image/machine-image.ts#L210)

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';

declare const userData: ec2.UserData;
const genericSSMParameterImage = new ec2.GenericSSMParameterImage('parameterName', ec2.OperatingSystemType.LINUX, /* all optional props */ userData);
```

## Initializer

```ts
new GenericSSMParameterImage(parameterName: string, os: OperatingSystemType, userData?: UserData)
```

## Properties

- `parameterName`: string (required) — Name of the SSM parameter we're looking up.

## Methods

- `getImage(scope: Construct): MachineImageConfig` — Return the image to use in the given context.
