# StringParameterProps

Properties needed to create a String SSM parameter.

Extends: StringParameterProps
Extends: ParameterOptions
Used as props by: StringParameter

- Source: [`aws-ssm/lib/parameter.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-ssm/lib/parameter.ts#L138)
- Type last changed: v2.42.0 · 16 Sep 2022

## Example

```ts
import * as lambda from 'aws-cdk-lib/aws-lambda';

const simpleParameter = new ssm.StringParameter(this, 'StringParameter', {
  // the parameter name doesn't contain any '/'
  parameterName: 'parameter',
  stringValue: 'SOME_VALUE',
  simpleName: true, // set `simpleName` to true
});

declare const func: lambda.IFunction;
const nonSimpleParameter = new ssm.StringParameter(this, 'StringParameter', {
  // the parameter name contains '/'
  parameterName: `/${func.functionName}/my/app/param`,
  stringValue: 'SOME_VALUE',
  simpleName: false, // set `simpleName` to false
});
```

## Properties

- `allowedPattern`: string = no validation is performed — A regular expression used to validate the parameter value.

  For example, for String types with values restricted to
  numbers, you can specify the following: ``^\d+$``

- `dataType`: [ParameterDataType](/cdk/api/v2/docs/aws-cdk-lib.aws_ssm.ParameterDataType.html) = ParameterDataType.TEXT — The data type of the parameter, such as `text` or `aws:ec2:image`.

- `description`: string = none — Information about the parameter that you want to add to the system.

- `parameterName`: string = a name will be generated by CloudFormation — The name of the parameter.

  **Default:** a name will be generated by CloudFormation

- `simpleName`: boolean = auto-detect based on `parameterName` — Indicates whether the parameter name is a simple name.

  A parameter name
  without any "/" is considered a simple name. If the parameter name includes
  "/", setting simpleName to true might cause unintended issues such
  as duplicate "/" in the resulting ARN.

  This is required only if `parameterName` is a token, which means we
  are unable to detect if the name is simple or "path-like" for the purpose
  of rendering SSM parameter ARNs.

  If `parameterName` is not specified, `simpleName` must be `true` (or
  undefined) since the name generated by AWS CloudFormation is always a
  simple name.

  **Default:** auto-detect based on `parameterName`

- `stringValue`: string (required) — The value of the parameter.

  It may not reference another parameter and ``{{}}`` cannot be used in the value.

- `tier`: [ParameterTier](/cdk/api/v2/docs/aws-cdk-lib.aws_ssm.ParameterTier.html) = undefined — The tier of the string parameter.

- `type`: [ParameterType](/cdk/api/v2/docs/aws-cdk-lib.aws_ssm.ParameterType.html) = ParameterType.STRING — - type will always be 'String'
