# Parameter

Class · Stable

Defines a parameter for an extension.

Obtainable from: Parameter.notRequired, Parameter.required

- Source: [`aws-appconfig/lib/extension.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-appconfig/lib/extension.ts#L245)
- Type last changed: v2.130.0 · 23 Feb 2024

## Example

TypeScript:

```ts
declare const fn: lambda.Function;

new appconfig.Extension(this, 'MyExtension', {
  actions: [
    new appconfig.Action({
      actionPoints: [appconfig.ActionPoint.ON_DEPLOYMENT_START],
      eventDestination: new appconfig.LambdaDestination(fn),
    }),
  ],
  parameters: [
    appconfig.Parameter.required('testParam', 'true'),
    appconfig.Parameter.notRequired('testNotRequiredParam'),
  ]
});
```

Python:

```python
# fn: lambda.Function

appconfig.Extension(self, "MyExtension",
    actions=[
        appconfig.Action(
            action_points=[appconfig.ActionPoint.ON_DEPLOYMENT_START],
            event_destination=appconfig.LambdaDestination(fn)
        )
    ],
    parameters=[
        appconfig.Parameter.required("testParam", "true"),
        appconfig.Parameter.not_required("testNotRequiredParam")
    ]
)
```

Java:

```java
Function fn;

Extension.Builder.create(this, "MyExtension")
        .actions(List.of(
            Action.Builder.create()
                    .actionPoints(List.of(ActionPoint.ON_DEPLOYMENT_START))
                    .eventDestination(new LambdaDestination(fn))
                    .build()))
        .parameters(List.of(Parameter.required("testParam", "true"), Parameter.notRequired("testNotRequiredParam")))
        .build();
```

C#:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
Function fn;

new Extension(this, "MyExtension", new ExtensionProps {
    Actions = new [] {
        new Action(new ActionProps {
            ActionPoints = new [] { ActionPoint.ON_DEPLOYMENT_START },
            EventDestination = new LambdaDestination(fn)
        }) },
    Parameters = new [] { Parameter.Required("testParam", "true"), Parameter.NotRequired("testNotRequiredParam") }
});
```

Go:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var fn Function

appconfig.NewExtension(this, jsii.String("MyExtension"), &ExtensionProps{
	Actions: []Action{
		appconfig.NewAction(&ActionProps{
			ActionPoints: []ActionPoint{
				appconfig.ActionPoint_ON_DEPLOYMENT_START,
			},
			EventDestination: appconfig.NewLambdaDestination(fn),
		}),
	},
	Parameters: []Parameter{
		appconfig.Parameter_Required(jsii.String("testParam"), jsii.String("true")),
		appconfig.Parameter_NotRequired(jsii.String("testNotRequiredParam")),
	},
})
```

## Properties

- `description`: string — The description of the parameter.

- `isRequired`: boolean — A boolean that indicates if the parameter is required or optional.

- `name`: string — The name of the parameter.

- `value`: string — The value of the parameter.

## Methods

- `notRequired(name: string, value?: string, description?: string): Parameter // chainable` (static) — An optional parameter for an extension.

  **Parameters**

  - `name` — The name of the parameter.
  - `value` — The value of the parameter.
  - `description` — A description for the parameter.

- `required(name: string, value: string, description?: string): Parameter // chainable` (static) — A required parameter for an extension.

  **Parameters**

  - `name` — The name of the parameter.
  - `value` — The value of the parameter.
  - `description` — A description for the parameter.
