# CfnSubscriptionDefinitionProps

Struct · External

Properties for defining a `CfnSubscriptionDefinition`.

Used as props by: [CfnSubscriptionDefinition](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_greengrass.CfnSubscriptionDefinition.html)

- Source: Generated at build time

## Example

TypeScript:

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

declare const tags: any;
const cfnSubscriptionDefinitionProps: greengrass.CfnSubscriptionDefinitionProps = {
  name: 'name',

  // the properties below are optional
  initialVersion: {
    subscriptions: [{
      id: 'id',
      source: 'source',
      subject: 'subject',
      target: 'target',
    }],
  },
  tags: tags,
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_greengrass as greengrass

# tags: Any

cfn_subscription_definition_props = greengrass.CfnSubscriptionDefinitionProps(
    name="name",

    # the properties below are optional
    initial_version=greengrass.CfnSubscriptionDefinition.SubscriptionDefinitionVersionProperty(
        subscriptions=[greengrass.CfnSubscriptionDefinition.SubscriptionProperty(
            id="id",
            source="source",
            subject="subject",
            target="target"
        )]
    ),
    tags=tags
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.greengrass.*;

Object tags;

CfnSubscriptionDefinitionProps cfnSubscriptionDefinitionProps = CfnSubscriptionDefinitionProps.builder()
        .name("name")

        // the properties below are optional
        .initialVersion(SubscriptionDefinitionVersionProperty.builder()
                .subscriptions(List.of(SubscriptionProperty.builder()
                        .id("id")
                        .source("source")
                        .subject("subject")
                        .target("target")
                        .build()))
                .build())
        .tags(tags)
        .build();
```

C#:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Greengrass;

var tags;

var cfnSubscriptionDefinitionProps = new CfnSubscriptionDefinitionProps {
    Name = "name",

    // the properties below are optional
    InitialVersion = new SubscriptionDefinitionVersionProperty {
        Subscriptions = new [] { new SubscriptionProperty {
            Id = "id",
            Source = "source",
            Subject = "subject",
            Target = "target"
        } }
    },
    Tags = tags
};
```

Go:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var tags interface{}

cfnSubscriptionDefinitionProps := &CfnSubscriptionDefinitionProps{
	Name: jsii.String("name"),

	// the properties below are optional
	InitialVersion: &SubscriptionDefinitionVersionProperty{
		Subscriptions: []interface{}{
			&SubscriptionProperty{
				Id: jsii.String("id"),
				Source: jsii.String("source"),
				Subject: jsii.String("subject"),
				Target: jsii.String("target"),
			},
		},
	},
	Tags: tags,
}
```

## Properties

- `initialVersion`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnSubscriptionDefinition.SubscriptionDefinitionVersionProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_greengrass.CfnSubscriptionDefinition.SubscriptionDefinitionVersionProperty.html) — The subscription definition version to include when the subscription definition is created.

  A subscription definition version contains a list of [`subscription`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-subscriptiondefinition-subscription.html) property types.

  > To associate a subscription definition version after the subscription definition is created, create an [`AWS::Greengrass::SubscriptionDefinitionVersion`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-greengrass-subscriptiondefinitionversion.html) resource and specify the ID of this subscription definition.

- `name`: string (required) — The name of the subscription definition.

- `tags`: any — Application-specific metadata to attach to the subscription definition.

  You can use tags in IAM policies to control access to AWS IoT Greengrass resources. You can also use tags to categorize your resources. For more information, see [Tagging Your AWS IoT Greengrass Resources](https://docs.aws.amazon.com/greengrass/v1/developerguide/tagging.html) in the *Developer Guide* .

  This `Json` property type is processed as a map of key-value pairs. It uses the following format, which is different from most `Tags` implementations in CloudFormation templates.

  ```json
  "Tags": { "KeyName0": "value", "KeyName1": "value", "KeyName2": "value"
  }
  ```
