Documentation ¶
Index ¶
- func CfnSubscription_CFN_RESOURCE_TYPE_NAME() *string
- func CfnSubscription_IsCfnElement(x interface{}) *bool
- func CfnSubscription_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnSubscription_IsConstruct(x interface{}) *bool
- func CfnTopicPolicy_CFN_RESOURCE_TYPE_NAME() *string
- func CfnTopicPolicy_IsCfnElement(x interface{}) *bool
- func CfnTopicPolicy_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnTopicPolicy_IsConstruct(x interface{}) *bool
- func CfnTopic_CFN_RESOURCE_TYPE_NAME() *string
- func CfnTopic_IsCfnElement(x interface{}) *bool
- func CfnTopic_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnTopic_IsConstruct(x interface{}) *bool
- func NewCfnSubscription_Override(c CfnSubscription, scope constructs.Construct, id *string, ...)
- func NewCfnTopicPolicy_Override(c CfnTopicPolicy, scope constructs.Construct, id *string, ...)
- func NewCfnTopic_Override(c CfnTopic, scope constructs.Construct, id *string, props *CfnTopicProps)
- func NewFilterOrPolicy_Override(f FilterOrPolicy)
- func NewFilter_Override(f Filter, filterDoc SubscriptionFilter)
- func NewPolicy_Override(p Policy, policyDoc *map[string]FilterOrPolicy)
- func NewSubscriptionFilter_Override(s SubscriptionFilter, conditions *[]interface{})
- func NewSubscription_Override(s Subscription, scope constructs.Construct, id *string, ...)
- func NewTopicBase_Override(t TopicBase, scope constructs.Construct, id *string, ...)
- func NewTopicPolicy_Override(t TopicPolicy, scope constructs.Construct, id *string, props *TopicPolicyProps)
- func NewTopic_Override(t Topic, scope constructs.Construct, id *string, props *TopicProps)
- func Subscription_IsConstruct(x interface{}) *bool
- func Subscription_IsOwnedResource(construct constructs.IConstruct) *bool
- func Subscription_IsResource(construct constructs.IConstruct) *bool
- func TopicBase_IsConstruct(x interface{}) *bool
- func TopicBase_IsOwnedResource(construct constructs.IConstruct) *bool
- func TopicBase_IsResource(construct constructs.IConstruct) *bool
- func TopicPolicy_IsConstruct(x interface{}) *bool
- func TopicPolicy_IsOwnedResource(construct constructs.IConstruct) *bool
- func TopicPolicy_IsResource(construct constructs.IConstruct) *bool
- func Topic_IsConstruct(x interface{}) *bool
- func Topic_IsOwnedResource(construct constructs.IConstruct) *bool
- func Topic_IsResource(construct constructs.IConstruct) *bool
- type BetweenCondition
- type CfnSubscription
- type CfnSubscriptionProps
- type CfnTopic
- type CfnTopicPolicy
- type CfnTopicPolicyProps
- type CfnTopicProps
- type CfnTopic_SubscriptionProperty
- type Filter
- type FilterOrPolicy
- type FilterOrPolicyType
- type ITopic
- type ITopicSubscription
- type NumericConditions
- type Policy
- type StringConditions
- type Subscription
- type SubscriptionFilter
- func NewSubscriptionFilter(conditions *[]interface{}) SubscriptionFilter
- func SubscriptionFilter_ExistsFilter() SubscriptionFilter
- func SubscriptionFilter_NumericFilter(numericConditions *NumericConditions) SubscriptionFilter
- func SubscriptionFilter_StringFilter(stringConditions *StringConditions) SubscriptionFilter
- type SubscriptionOptions
- type SubscriptionProps
- type SubscriptionProtocol
- type Topic
- type TopicBase
- type TopicPolicy
- type TopicPolicyProps
- type TopicProps
- type TopicSubscriptionConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CfnSubscription_CFN_RESOURCE_TYPE_NAME ¶
func CfnSubscription_CFN_RESOURCE_TYPE_NAME() *string
func CfnSubscription_IsCfnElement ¶
func CfnSubscription_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element.
func CfnSubscription_IsCfnResource ¶
func CfnSubscription_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource.
func CfnSubscription_IsConstruct ¶
func CfnSubscription_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func CfnTopicPolicy_CFN_RESOURCE_TYPE_NAME ¶
func CfnTopicPolicy_CFN_RESOURCE_TYPE_NAME() *string
func CfnTopicPolicy_IsCfnElement ¶
func CfnTopicPolicy_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element.
func CfnTopicPolicy_IsCfnResource ¶
func CfnTopicPolicy_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource.
func CfnTopicPolicy_IsConstruct ¶
func CfnTopicPolicy_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func CfnTopic_CFN_RESOURCE_TYPE_NAME ¶
func CfnTopic_CFN_RESOURCE_TYPE_NAME() *string
func CfnTopic_IsCfnElement ¶
func CfnTopic_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element.
func CfnTopic_IsCfnResource ¶
func CfnTopic_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource.
func CfnTopic_IsConstruct ¶
func CfnTopic_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func NewCfnSubscription_Override ¶
func NewCfnSubscription_Override(c CfnSubscription, scope constructs.Construct, id *string, props *CfnSubscriptionProps)
Create a new `AWS::SNS::Subscription`.
func NewCfnTopicPolicy_Override ¶
func NewCfnTopicPolicy_Override(c CfnTopicPolicy, scope constructs.Construct, id *string, props *CfnTopicPolicyProps)
Create a new `AWS::SNS::TopicPolicy`.
func NewCfnTopic_Override ¶
func NewCfnTopic_Override(c CfnTopic, scope constructs.Construct, id *string, props *CfnTopicProps)
Create a new `AWS::SNS::Topic`.
func NewFilterOrPolicy_Override ¶ added in v2.67.0
func NewFilterOrPolicy_Override(f FilterOrPolicy)
func NewFilter_Override ¶ added in v2.67.0
func NewFilter_Override(f Filter, filterDoc SubscriptionFilter)
Policy constructor.
func NewPolicy_Override ¶ added in v2.67.0
func NewPolicy_Override(p Policy, policyDoc *map[string]FilterOrPolicy)
Policy constructor.
func NewSubscriptionFilter_Override ¶
func NewSubscriptionFilter_Override(s SubscriptionFilter, conditions *[]interface{})
func NewSubscription_Override ¶
func NewSubscription_Override(s Subscription, scope constructs.Construct, id *string, props *SubscriptionProps)
func NewTopicBase_Override ¶
func NewTopicPolicy_Override ¶
func NewTopicPolicy_Override(t TopicPolicy, scope constructs.Construct, id *string, props *TopicPolicyProps)
func NewTopic_Override ¶
func NewTopic_Override(t Topic, scope constructs.Construct, id *string, props *TopicProps)
func Subscription_IsConstruct ¶
func Subscription_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func Subscription_IsOwnedResource ¶ added in v2.32.0
func Subscription_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise.
func Subscription_IsResource ¶
func Subscription_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func TopicBase_IsConstruct ¶
func TopicBase_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func TopicBase_IsOwnedResource ¶ added in v2.32.0
func TopicBase_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise.
func TopicBase_IsResource ¶
func TopicBase_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func TopicPolicy_IsConstruct ¶
func TopicPolicy_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func TopicPolicy_IsOwnedResource ¶ added in v2.32.0
func TopicPolicy_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise.
func TopicPolicy_IsResource ¶
func TopicPolicy_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func Topic_IsConstruct ¶
func Topic_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func Topic_IsOwnedResource ¶ added in v2.32.0
func Topic_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise.
func Topic_IsResource ¶
func Topic_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
Types ¶
type BetweenCondition ¶
type BetweenCondition struct { // The start value. Start *float64 `field:"required" json:"start" yaml:"start"` // The stop value. Stop *float64 `field:"required" json:"stop" yaml:"stop"` }
Between condition for a numeric attribute.
Example:
import lambda "github.com/aws/aws-cdk-go/awscdk" var fn function myTopic := sns.NewTopic(this, jsii.String("MyTopic")) // Lambda should receive only message matching the following conditions on attributes: // color: 'red' or 'orange' or begins with 'bl' // size: anything but 'small' or 'medium' // price: between 100 and 200 or greater than 300 // store: attribute must be present myTopic.AddSubscription(subscriptions.NewLambdaSubscription(fn, &LambdaSubscriptionProps{ FilterPolicy: map[string]subscriptionFilter{ "color": sns.*subscriptionFilter_stringFilter(&StringConditions{ "allowlist": []*string{ jsii.String("red"), jsii.String("orange"), }, "matchPrefixes": []*string{ jsii.String("bl"), }, }), "size": sns.*subscriptionFilter_stringFilter(&StringConditions{ "denylist": []*string{ jsii.String("small"), jsii.String("medium"), }, }), "price": sns.*subscriptionFilter_numericFilter(&NumericConditions{ "between": &BetweenCondition{ "start": jsii.Number(100), "stop": jsii.Number(200), }, "greaterThan": jsii.Number(300), }), "store": sns.*subscriptionFilter_existsFilter(), }, }))
type CfnSubscription ¶
type CfnSubscription interface { awscdk.CfnResource awscdk.IInspectable // Options for this resource, such as condition, update policy etc. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. CfnResourceType() *string // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. CreationStack() *[]*string // The delivery policy JSON assigned to the subscription. // // Enables the subscriber to define the message delivery retry strategy in the case of an HTTP/S endpoint subscribed to the topic. For more information, see `[GetSubscriptionAttributes](https://docs.aws.amazon.com/sns/latest/api/API_GetSubscriptionAttributes.html)` in the *Amazon SNS API Reference* and [Message delivery retries](https://docs.aws.amazon.com/sns/latest/dg/sns-message-delivery-retries.html) in the *Amazon SNS Developer Guide* . DeliveryPolicy() interface{} SetDeliveryPolicy(val interface{}) // The subscription's endpoint. // // The endpoint value depends on the protocol that you specify. For more information, see the `Endpoint` parameter of the `[Subscribe](https://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html)` action in the *Amazon SNS API Reference* . Endpoint() *string SetEndpoint(val *string) // The filter policy JSON assigned to the subscription. // // Enables the subscriber to filter out unwanted messages. For more information, see `[GetSubscriptionAttributes](https://docs.aws.amazon.com/sns/latest/api/API_GetSubscriptionAttributes.html)` in the *Amazon SNS API Reference* and [Message filtering](https://docs.aws.amazon.com/sns/latest/dg/sns-message-filtering.html) in the *Amazon SNS Developer Guide* . FilterPolicy() interface{} SetFilterPolicy(val interface{}) // This attribute lets you choose the filtering scope by using one of the following string value types:. // // - `MessageAttributes` (default) - The filter is applied on the message attributes. // - `MessageBody` - The filter is applied on the message body. FilterPolicyScope() *string SetFilterPolicyScope(val *string) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. LogicalId() *string // The tree node. Node() constructs.Node // The subscription's protocol. // // For more information, see the `Protocol` parameter of the `[Subscribe](https://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html)` action in the *Amazon SNS API Reference* . Protocol() *string SetProtocol(val *string) // When set to `true` , enables raw message delivery. // // Raw messages don't contain any JSON formatting and can be sent to Amazon SQS and HTTP/S endpoints. For more information, see `[GetSubscriptionAttributes](https://docs.aws.amazon.com/sns/latest/api/API_GetSubscriptionAttributes.html)` in the *Amazon SNS API Reference* . RawMessageDelivery() interface{} SetRawMessageDelivery(val interface{}) // When specified, sends undeliverable messages to the specified Amazon SQS dead-letter queue. // // Messages that can't be delivered due to client errors (for example, when the subscribed endpoint is unreachable) or server errors (for example, when the service that powers the subscribed endpoint becomes unavailable) are held in the dead-letter queue for further analysis or reprocessing. // // For more information about the redrive policy and dead-letter queues, see [Amazon SQS dead-letter queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) in the *Amazon SQS Developer Guide* . RedrivePolicy() interface{} SetRedrivePolicy(val interface{}) // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. Ref() *string // For cross-region subscriptions, the region in which the topic resides. // // If no region is specified, AWS CloudFormation uses the region of the caller as the default. // // If you perform an update operation that only updates the `Region` property of a `AWS::SNS::Subscription` resource, that operation will fail unless you are either: // // - Updating the `Region` from `NULL` to the caller region. // - Updating the `Region` from the caller region to `NULL` . Region() *string SetRegion(val *string) // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). Stack() awscdk.Stack // This property applies only to Amazon Kinesis Data Firehose delivery stream subscriptions. // // Specify the ARN of the IAM role that has the following: // // - Permission to write to the Amazon Kinesis Data Firehose delivery stream // - Amazon SNS listed as a trusted entity // // Specifying a valid ARN for this attribute is required for Kinesis Data Firehose delivery stream subscriptions. For more information, see [Fanout to Amazon Kinesis Data Firehose delivery streams](https://docs.aws.amazon.com/sns/latest/dg/sns-firehose-as-subscriber.html) in the *Amazon SNS Developer Guide.* SubscriptionRoleArn() *string SetSubscriptionRoleArn(val *string) // The ARN of the topic to subscribe to. TopicArn() *string SetTopicArn(val *string) // Deprecated. // Deprecated: use `updatedProperties` // // Return properties modified after initiation // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperites() *map[string]interface{} // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperties() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. AddDependency(target awscdk.CfnResource) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // Deprecated: use addDependency. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some // cases, a snapshot can be taken of the resource prior to deletion // (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy // can be found in the following link:. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options // ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Retrieves an array of resources this resource depends on. // // This assembles dependencies on resources across stacks (including nested stacks) // automatically. ObtainDependencies() *[]interface{} // Get a shallow copy of dependencies between this resource and other resources in the same stack. ObtainResourceDependencies() *[]awscdk.CfnResource // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) // Indicates that this resource no longer depends on another resource. // // This can be used for resources across stacks (including nested stacks) // and the dependency will automatically be removed from the relevant scope. RemoveDependency(target awscdk.CfnResource) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Replaces one dependency with another. ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource) // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. ShouldSynthesize() *bool // Returns a string representation of this construct. // // Returns: a string representation of this resource. ToString() *string ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::SNS::Subscription`.
The `AWS::SNS::Subscription` resource subscribes an endpoint to an Amazon SNS topic. For a subscription to be created, the owner of the endpoint must confirm the subscription.
Example:
// 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 deliveryPolicy interface{} var filterPolicy interface{} var redrivePolicy interface{} cfnSubscription := awscdk.Aws_sns.NewCfnSubscription(this, jsii.String("MyCfnSubscription"), &CfnSubscriptionProps{ Protocol: jsii.String("protocol"), TopicArn: jsii.String("topicArn"), // the properties below are optional DeliveryPolicy: deliveryPolicy, Endpoint: jsii.String("endpoint"), FilterPolicy: filterPolicy, FilterPolicyScope: jsii.String("filterPolicyScope"), RawMessageDelivery: jsii.Boolean(false), RedrivePolicy: redrivePolicy, Region: jsii.String("region"), SubscriptionRoleArn: jsii.String("subscriptionRoleArn"), })
func NewCfnSubscription ¶
func NewCfnSubscription(scope constructs.Construct, id *string, props *CfnSubscriptionProps) CfnSubscription
Create a new `AWS::SNS::Subscription`.
type CfnSubscriptionProps ¶
type CfnSubscriptionProps struct { // The subscription's protocol. // // For more information, see the `Protocol` parameter of the `[Subscribe](https://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html)` action in the *Amazon SNS API Reference* . Protocol *string `field:"required" json:"protocol" yaml:"protocol"` // The ARN of the topic to subscribe to. TopicArn *string `field:"required" json:"topicArn" yaml:"topicArn"` // The delivery policy JSON assigned to the subscription. // // Enables the subscriber to define the message delivery retry strategy in the case of an HTTP/S endpoint subscribed to the topic. For more information, see `[GetSubscriptionAttributes](https://docs.aws.amazon.com/sns/latest/api/API_GetSubscriptionAttributes.html)` in the *Amazon SNS API Reference* and [Message delivery retries](https://docs.aws.amazon.com/sns/latest/dg/sns-message-delivery-retries.html) in the *Amazon SNS Developer Guide* . DeliveryPolicy interface{} `field:"optional" json:"deliveryPolicy" yaml:"deliveryPolicy"` // The subscription's endpoint. // // The endpoint value depends on the protocol that you specify. For more information, see the `Endpoint` parameter of the `[Subscribe](https://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html)` action in the *Amazon SNS API Reference* . Endpoint *string `field:"optional" json:"endpoint" yaml:"endpoint"` // The filter policy JSON assigned to the subscription. // // Enables the subscriber to filter out unwanted messages. For more information, see `[GetSubscriptionAttributes](https://docs.aws.amazon.com/sns/latest/api/API_GetSubscriptionAttributes.html)` in the *Amazon SNS API Reference* and [Message filtering](https://docs.aws.amazon.com/sns/latest/dg/sns-message-filtering.html) in the *Amazon SNS Developer Guide* . FilterPolicy interface{} `field:"optional" json:"filterPolicy" yaml:"filterPolicy"` // This attribute lets you choose the filtering scope by using one of the following string value types:. // // - `MessageAttributes` (default) - The filter is applied on the message attributes. // - `MessageBody` - The filter is applied on the message body. FilterPolicyScope *string `field:"optional" json:"filterPolicyScope" yaml:"filterPolicyScope"` // When set to `true` , enables raw message delivery. // // Raw messages don't contain any JSON formatting and can be sent to Amazon SQS and HTTP/S endpoints. For more information, see `[GetSubscriptionAttributes](https://docs.aws.amazon.com/sns/latest/api/API_GetSubscriptionAttributes.html)` in the *Amazon SNS API Reference* . RawMessageDelivery interface{} `field:"optional" json:"rawMessageDelivery" yaml:"rawMessageDelivery"` // When specified, sends undeliverable messages to the specified Amazon SQS dead-letter queue. // // Messages that can't be delivered due to client errors (for example, when the subscribed endpoint is unreachable) or server errors (for example, when the service that powers the subscribed endpoint becomes unavailable) are held in the dead-letter queue for further analysis or reprocessing. // // For more information about the redrive policy and dead-letter queues, see [Amazon SQS dead-letter queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) in the *Amazon SQS Developer Guide* . RedrivePolicy interface{} `field:"optional" json:"redrivePolicy" yaml:"redrivePolicy"` // For cross-region subscriptions, the region in which the topic resides. // // If no region is specified, AWS CloudFormation uses the region of the caller as the default. // // If you perform an update operation that only updates the `Region` property of a `AWS::SNS::Subscription` resource, that operation will fail unless you are either: // // - Updating the `Region` from `NULL` to the caller region. // - Updating the `Region` from the caller region to `NULL` . Region *string `field:"optional" json:"region" yaml:"region"` // This property applies only to Amazon Kinesis Data Firehose delivery stream subscriptions. // // Specify the ARN of the IAM role that has the following: // // - Permission to write to the Amazon Kinesis Data Firehose delivery stream // - Amazon SNS listed as a trusted entity // // Specifying a valid ARN for this attribute is required for Kinesis Data Firehose delivery stream subscriptions. For more information, see [Fanout to Amazon Kinesis Data Firehose delivery streams](https://docs.aws.amazon.com/sns/latest/dg/sns-firehose-as-subscriber.html) in the *Amazon SNS Developer Guide.* SubscriptionRoleArn *string `field:"optional" json:"subscriptionRoleArn" yaml:"subscriptionRoleArn"` }
Properties for defining a `CfnSubscription`.
Example:
// 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 deliveryPolicy interface{} var filterPolicy interface{} var redrivePolicy interface{} cfnSubscriptionProps := &CfnSubscriptionProps{ Protocol: jsii.String("protocol"), TopicArn: jsii.String("topicArn"), // the properties below are optional DeliveryPolicy: deliveryPolicy, Endpoint: jsii.String("endpoint"), FilterPolicy: filterPolicy, FilterPolicyScope: jsii.String("filterPolicyScope"), RawMessageDelivery: jsii.Boolean(false), RedrivePolicy: redrivePolicy, Region: jsii.String("region"), SubscriptionRoleArn: jsii.String("subscriptionRoleArn"), }
type CfnTopic ¶
type CfnTopic interface { awscdk.CfnResource awscdk.IInspectable // Returns the ARN of an Amazon SNS topic. AttrTopicArn() *string // Returns the name of an Amazon SNS topic. AttrTopicName() *string // Options for this resource, such as condition, update policy etc. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. CfnResourceType() *string // Enables content-based deduplication for FIFO topics. // // - By default, `ContentBasedDeduplication` is set to `false` . If you create a FIFO topic and this attribute is `false` , you must specify a value for the `MessageDeduplicationId` parameter for the [Publish](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html) action. // - When you set `ContentBasedDeduplication` to `true` , Amazon SNS uses a SHA-256 hash to generate the `MessageDeduplicationId` using the body of the message (but not the attributes of the message). // // (Optional) To override the generated value, you can specify a value for the the `MessageDeduplicationId` parameter for the `Publish` action. ContentBasedDeduplication() interface{} SetContentBasedDeduplication(val interface{}) // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. CreationStack() *[]*string // The body of the policy document you want to use for this topic. // // You can only add one policy per topic. // // The policy must be in JSON string format. // // Length Constraints: Maximum length of 30,720. DataProtectionPolicy() interface{} SetDataProtectionPolicy(val interface{}) // The display name to use for an Amazon SNS topic with SMS subscriptions. // // The display name must be maximum 100 characters long, including hyphens (-), underscores (_), spaces, and tabs. DisplayName() *string SetDisplayName(val *string) // Set to true to create a FIFO topic. FifoTopic() interface{} SetFifoTopic(val interface{}) // The ID of an AWS managed customer master key (CMK) for Amazon SNS or a custom CMK. // // For more information, see [Key terms](https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms) . For more examples, see `[KeyId](https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters)` in the *AWS Key Management Service API Reference* . // // This property applies only to [server-side-encryption](https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html) . KmsMasterKeyId() *string SetKmsMasterKeyId(val *string) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. LogicalId() *string // The tree node. Node() constructs.Node // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. Ref() *string // The signature version corresponds to the hashing algorithm used while creating the signature of the notifications, subscription confirmations, or unsubscribe confirmation messages sent by Amazon SNS. // // By default, `SignatureVersion` is set to `1` . SignatureVersion() *string SetSignatureVersion(val *string) // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). Stack() awscdk.Stack // The Amazon SNS subscriptions (endpoints) for this topic. // // > If you specify the `Subscription` property in the `AWS::SNS::Topic` resource and it creates an associated subscription resource, the associated subscription is not deleted when the `AWS::SNS::Topic` resource is deleted. Subscription() interface{} SetSubscription(val interface{}) // The list of tags to add to a new topic. // // > To be able to tag a topic on creation, you must have the `sns:CreateTopic` and `sns:TagResource` permissions. Tags() awscdk.TagManager // The name of the topic you want to create. // // Topic names must include only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long. FIFO topic names must end with `.fifo` . // // If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the topic name. For more information, see [Name type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html) . // // > If you specify a name, you can't perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name. TopicName() *string SetTopicName(val *string) // Tracing mode of an Amazon SNS topic. // // By default `TracingConfig` is set to `PassThrough` , and the topic passes through the tracing header it receives from an SNS publisher to its subscriptions. If set to `Active` , SNS will vend X-Ray segment data to topic owner account if the sampled flag in the tracing header is true. Only supported on standard topics. TracingConfig() *string SetTracingConfig(val *string) // Deprecated. // Deprecated: use `updatedProperties` // // Return properties modified after initiation // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperites() *map[string]interface{} // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperties() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. AddDependency(target awscdk.CfnResource) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // Deprecated: use addDependency. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some // cases, a snapshot can be taken of the resource prior to deletion // (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy // can be found in the following link:. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options // ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Retrieves an array of resources this resource depends on. // // This assembles dependencies on resources across stacks (including nested stacks) // automatically. ObtainDependencies() *[]interface{} // Get a shallow copy of dependencies between this resource and other resources in the same stack. ObtainResourceDependencies() *[]awscdk.CfnResource // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) // Indicates that this resource no longer depends on another resource. // // This can be used for resources across stacks (including nested stacks) // and the dependency will automatically be removed from the relevant scope. RemoveDependency(target awscdk.CfnResource) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Replaces one dependency with another. ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource) // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. ShouldSynthesize() *bool // Returns a string representation of this construct. // // Returns: a string representation of this resource. ToString() *string ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::SNS::Topic`.
The `AWS::SNS::Topic` resource creates a topic to which notifications can be published.
> One account can create a maximum of 100,000 standard topics and 1,000 FIFO topics. For more information, see [Amazon SNS endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/sns.html) in the *AWS General Reference* .
Example:
// 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 dataProtectionPolicy interface{} cfnTopic := awscdk.Aws_sns.NewCfnTopic(this, jsii.String("MyCfnTopic"), &CfnTopicProps{ ContentBasedDeduplication: jsii.Boolean(false), DataProtectionPolicy: dataProtectionPolicy, DisplayName: jsii.String("displayName"), FifoTopic: jsii.Boolean(false), KmsMasterKeyId: jsii.String("kmsMasterKeyId"), SignatureVersion: jsii.String("signatureVersion"), Subscription: []interface{}{ &SubscriptionProperty{ Endpoint: jsii.String("endpoint"), Protocol: jsii.String("protocol"), }, }, Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, TopicName: jsii.String("topicName"), TracingConfig: jsii.String("tracingConfig"), })
func NewCfnTopic ¶
func NewCfnTopic(scope constructs.Construct, id *string, props *CfnTopicProps) CfnTopic
Create a new `AWS::SNS::Topic`.
type CfnTopicPolicy ¶
type CfnTopicPolicy interface { awscdk.CfnResource awscdk.IInspectable // Options for this resource, such as condition, update policy etc. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. CfnResourceType() *string // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. CreationStack() *[]*string // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. LogicalId() *string // The tree node. Node() constructs.Node // A policy document that contains permissions to add to the specified SNS topics. PolicyDocument() interface{} SetPolicyDocument(val interface{}) // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. Ref() *string // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). Stack() awscdk.Stack // The Amazon Resource Names (ARN) of the topics to which you want to add the policy. // // You can use the `[Ref](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html)` function to specify an `[AWS::SNS::Topic](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topic.html)` resource. Topics() *[]*string SetTopics(val *[]*string) // Deprecated. // Deprecated: use `updatedProperties` // // Return properties modified after initiation // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperites() *map[string]interface{} // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperties() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. AddDependency(target awscdk.CfnResource) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // Deprecated: use addDependency. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some // cases, a snapshot can be taken of the resource prior to deletion // (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy // can be found in the following link:. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options // ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Retrieves an array of resources this resource depends on. // // This assembles dependencies on resources across stacks (including nested stacks) // automatically. ObtainDependencies() *[]interface{} // Get a shallow copy of dependencies between this resource and other resources in the same stack. ObtainResourceDependencies() *[]awscdk.CfnResource // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) // Indicates that this resource no longer depends on another resource. // // This can be used for resources across stacks (including nested stacks) // and the dependency will automatically be removed from the relevant scope. RemoveDependency(target awscdk.CfnResource) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Replaces one dependency with another. ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource) // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. ShouldSynthesize() *bool // Returns a string representation of this construct. // // Returns: a string representation of this resource. ToString() *string ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::SNS::TopicPolicy`.
The `AWS::SNS::TopicPolicy` resource associates Amazon SNS topics with a policy. For an example snippet, see [Declaring an Amazon SNS policy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-iam.html#scenario-sns-policy) in the *AWS CloudFormation User Guide* .
Example:
// 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 policyDocument interface{} cfnTopicPolicy := awscdk.Aws_sns.NewCfnTopicPolicy(this, jsii.String("MyCfnTopicPolicy"), &CfnTopicPolicyProps{ PolicyDocument: policyDocument, Topics: []*string{ jsii.String("topics"), }, })
func NewCfnTopicPolicy ¶
func NewCfnTopicPolicy(scope constructs.Construct, id *string, props *CfnTopicPolicyProps) CfnTopicPolicy
Create a new `AWS::SNS::TopicPolicy`.
type CfnTopicPolicyProps ¶
type CfnTopicPolicyProps struct { // A policy document that contains permissions to add to the specified SNS topics. PolicyDocument interface{} `field:"required" json:"policyDocument" yaml:"policyDocument"` // The Amazon Resource Names (ARN) of the topics to which you want to add the policy. // // You can use the `[Ref](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html)` function to specify an `[AWS::SNS::Topic](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topic.html)` resource. Topics *[]*string `field:"required" json:"topics" yaml:"topics"` }
Properties for defining a `CfnTopicPolicy`.
Example:
// 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 policyDocument interface{} cfnTopicPolicyProps := &CfnTopicPolicyProps{ PolicyDocument: policyDocument, Topics: []*string{ jsii.String("topics"), }, }
type CfnTopicProps ¶
type CfnTopicProps struct { // Enables content-based deduplication for FIFO topics. // // - By default, `ContentBasedDeduplication` is set to `false` . If you create a FIFO topic and this attribute is `false` , you must specify a value for the `MessageDeduplicationId` parameter for the [Publish](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html) action. // - When you set `ContentBasedDeduplication` to `true` , Amazon SNS uses a SHA-256 hash to generate the `MessageDeduplicationId` using the body of the message (but not the attributes of the message). // // (Optional) To override the generated value, you can specify a value for the the `MessageDeduplicationId` parameter for the `Publish` action. ContentBasedDeduplication interface{} `field:"optional" json:"contentBasedDeduplication" yaml:"contentBasedDeduplication"` // The body of the policy document you want to use for this topic. // // You can only add one policy per topic. // // The policy must be in JSON string format. // // Length Constraints: Maximum length of 30,720. DataProtectionPolicy interface{} `field:"optional" json:"dataProtectionPolicy" yaml:"dataProtectionPolicy"` // The display name to use for an Amazon SNS topic with SMS subscriptions. // // The display name must be maximum 100 characters long, including hyphens (-), underscores (_), spaces, and tabs. DisplayName *string `field:"optional" json:"displayName" yaml:"displayName"` // Set to true to create a FIFO topic. FifoTopic interface{} `field:"optional" json:"fifoTopic" yaml:"fifoTopic"` // The ID of an AWS managed customer master key (CMK) for Amazon SNS or a custom CMK. // // For more information, see [Key terms](https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms) . For more examples, see `[KeyId](https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters)` in the *AWS Key Management Service API Reference* . // // This property applies only to [server-side-encryption](https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html) . KmsMasterKeyId *string `field:"optional" json:"kmsMasterKeyId" yaml:"kmsMasterKeyId"` // The signature version corresponds to the hashing algorithm used while creating the signature of the notifications, subscription confirmations, or unsubscribe confirmation messages sent by Amazon SNS. // // By default, `SignatureVersion` is set to `1` . SignatureVersion *string `field:"optional" json:"signatureVersion" yaml:"signatureVersion"` // The Amazon SNS subscriptions (endpoints) for this topic. // // > If you specify the `Subscription` property in the `AWS::SNS::Topic` resource and it creates an associated subscription resource, the associated subscription is not deleted when the `AWS::SNS::Topic` resource is deleted. Subscription interface{} `field:"optional" json:"subscription" yaml:"subscription"` // The list of tags to add to a new topic. // // > To be able to tag a topic on creation, you must have the `sns:CreateTopic` and `sns:TagResource` permissions. Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"` // The name of the topic you want to create. // // Topic names must include only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long. FIFO topic names must end with `.fifo` . // // If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the topic name. For more information, see [Name type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html) . // // > If you specify a name, you can't perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name. TopicName *string `field:"optional" json:"topicName" yaml:"topicName"` // Tracing mode of an Amazon SNS topic. // // By default `TracingConfig` is set to `PassThrough` , and the topic passes through the tracing header it receives from an SNS publisher to its subscriptions. If set to `Active` , SNS will vend X-Ray segment data to topic owner account if the sampled flag in the tracing header is true. Only supported on standard topics. TracingConfig *string `field:"optional" json:"tracingConfig" yaml:"tracingConfig"` }
Properties for defining a `CfnTopic`.
Example:
// 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 dataProtectionPolicy interface{} cfnTopicProps := &CfnTopicProps{ ContentBasedDeduplication: jsii.Boolean(false), DataProtectionPolicy: dataProtectionPolicy, DisplayName: jsii.String("displayName"), FifoTopic: jsii.Boolean(false), KmsMasterKeyId: jsii.String("kmsMasterKeyId"), SignatureVersion: jsii.String("signatureVersion"), Subscription: []interface{}{ &SubscriptionProperty{ Endpoint: jsii.String("endpoint"), Protocol: jsii.String("protocol"), }, }, Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, TopicName: jsii.String("topicName"), TracingConfig: jsii.String("tracingConfig"), }
type CfnTopic_SubscriptionProperty ¶
type CfnTopic_SubscriptionProperty struct { // The endpoint that receives notifications from the Amazon SNS topic. // // The endpoint value depends on the protocol that you specify. For more information, see the `Endpoint` parameter of the `[Subscribe](https://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html)` action in the *Amazon SNS API Reference* . Endpoint *string `field:"required" json:"endpoint" yaml:"endpoint"` // The subscription's protocol. // // For more information, see the `Protocol` parameter of the `[Subscribe](https://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html)` action in the *Amazon SNS API Reference* . Protocol *string `field:"required" json:"protocol" yaml:"protocol"` }
`Subscription` is an embedded property that describes the subscription endpoints of an Amazon SNS topic.
> For full control over subscription behavior (for example, delivery policy, filtering, raw message delivery, and cross-region subscriptions), use the [AWS::SNS::Subscription](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-subscription.html) resource.
Example:
// 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" subscriptionProperty := &SubscriptionProperty{ Endpoint: jsii.String("endpoint"), Protocol: jsii.String("protocol"), }
type Filter ¶ added in v2.67.0
type Filter interface { FilterOrPolicy // filter argument to construct. FilterDoc() SubscriptionFilter // Type used in DFS buildFilterPolicyWithMessageBody to determine json value type. Type() FilterOrPolicyType // Check if instance is `Filter` type. IsFilter() *bool // Check if instance is `Policy` type. IsPolicy() *bool }
Filter implementation of FilterOrPolicy.
Example:
// 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 subscriptionFilter subscriptionFilter filter := awscdk.Aws_sns.NewFilter(subscriptionFilter)
func FilterOrPolicy_Filter ¶ added in v2.67.0
func FilterOrPolicy_Filter(filter SubscriptionFilter) Filter
Filter of MessageBody.
func Filter_Filter ¶ added in v2.67.0
func Filter_Filter(filter SubscriptionFilter) Filter
Filter of MessageBody.
func NewFilter ¶ added in v2.67.0
func NewFilter(filterDoc SubscriptionFilter) Filter
Policy constructor.
func Policy_Filter ¶ added in v2.67.0
func Policy_Filter(filter SubscriptionFilter) Filter
Filter of MessageBody.
type FilterOrPolicy ¶ added in v2.67.0
type FilterOrPolicy interface { // Type switch for disambiguating between subclasses. Type() FilterOrPolicyType // Check if instance is `Filter` type. IsFilter() *bool // Check if instance is `Policy` type. IsPolicy() *bool }
Class for building the FilterPolicy by avoiding union types.
Example:
import lambda "github.com/aws/aws-cdk-go/awscdk" var fn function myTopic := sns.NewTopic(this, jsii.String("MyTopic")) // Lambda should receive only message matching the following conditions on message body: // color: 'red' or 'orange' myTopic.AddSubscription(subscriptions.NewLambdaSubscription(fn, &LambdaSubscriptionProps{ FilterPolicyWithMessageBody: map[string]filterOrPolicy{ "background": sns.*filterOrPolicy_policy(map[string]*filterOrPolicy{ "color": sns.*filterOrPolicy_filter(sns.SubscriptionFilter_stringFilter(&StringConditions{ "allowlist": []*string{ jsii.String("red"), jsii.String("orange"), }, })), }), }, }))
type FilterOrPolicyType ¶ added in v2.67.0
type FilterOrPolicyType string
The type of the MessageBody at a given key value pair.
const ( // The filter of the MessageBody. FilterOrPolicyType_FILTER FilterOrPolicyType = "FILTER" // A nested key of the MessageBody. FilterOrPolicyType_POLICY FilterOrPolicyType = "POLICY" )
type ITopic ¶
type ITopic interface { awscodestarnotifications.INotificationRuleTarget awscdk.IResource // Subscribe some endpoint to this topic. AddSubscription(subscription ITopicSubscription) Subscription // Adds a statement to the IAM resource policy associated with this topic. // // If this topic was created in this stack (`new Topic`), a topic policy // will be automatically created upon the first call to `addToPolicy`. If // the topic is imported (`Topic.import`), then this is a no-op. AddToResourcePolicy(statement awsiam.PolicyStatement) *awsiam.AddToResourcePolicyResult // Grant topic publishing permissions to the given identity. GrantPublish(identity awsiam.IGrantable) awsiam.Grant // Return the given named metric for this Topic. Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The number of messages published to your Amazon SNS topics. // // Sum over 5 minutes. MetricNumberOfMessagesPublished(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The number of messages successfully delivered from your Amazon SNS topics to subscribing endpoints. // // Sum over 5 minutes. MetricNumberOfNotificationsDelivered(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The number of messages that Amazon SNS failed to deliver. // // Sum over 5 minutes. MetricNumberOfNotificationsFailed(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The number of messages that were rejected by subscription filter policies. // // Sum over 5 minutes. MetricNumberOfNotificationsFilteredOut(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The number of messages that were rejected by subscription filter policies because the messages' attributes are invalid. // // Sum over 5 minutes. MetricNumberOfNotificationsFilteredOutInvalidAttributes(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The number of messages that were rejected by subscription filter policies because the messages have no attributes. // // Sum over 5 minutes. MetricNumberOfNotificationsFilteredOutNoMessageAttributes(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Metric for the size of messages published through this topic. // // Average over 5 minutes. MetricPublishSize(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The charges you have accrued since the start of the current calendar month for sending SMS messages. // // Maximum over 5 minutes. MetricSMSMonthToDateSpentUSD(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The rate of successful SMS message deliveries. // // Sum over 5 minutes. MetricSMSSuccessRate(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Whether this topic is an Amazon SNS FIFO queue. // // If false, this is a standard topic. Fifo() *bool // The ARN of the topic. TopicArn() *string // The name of the topic. TopicName() *string }
Represents an SNS topic.
func Topic_FromTopicArn ¶
Import an existing SNS topic provided an ARN.
type ITopicSubscription ¶
type ITopicSubscription interface { // Returns a configuration used to subscribe to an SNS topic. Bind(topic ITopic) *TopicSubscriptionConfig }
Topic subscription.
type NumericConditions ¶
type NumericConditions struct { // Match one or more values. Allowlist *[]*float64 `field:"optional" json:"allowlist" yaml:"allowlist"` // Match values that are between the specified values. Between *BetweenCondition `field:"optional" json:"between" yaml:"between"` // Match values that are strictly between the specified values. BetweenStrict *BetweenCondition `field:"optional" json:"betweenStrict" yaml:"betweenStrict"` // Match values that are greater than the specified value. GreaterThan *float64 `field:"optional" json:"greaterThan" yaml:"greaterThan"` // Match values that are greater than or equal to the specified value. GreaterThanOrEqualTo *float64 `field:"optional" json:"greaterThanOrEqualTo" yaml:"greaterThanOrEqualTo"` // Match values that are less than the specified value. LessThan *float64 `field:"optional" json:"lessThan" yaml:"lessThan"` // Match values that are less than or equal to the specified value. LessThanOrEqualTo *float64 `field:"optional" json:"lessThanOrEqualTo" yaml:"lessThanOrEqualTo"` }
Conditions that can be applied to numeric attributes.
Example:
import lambda "github.com/aws/aws-cdk-go/awscdk" var fn function myTopic := sns.NewTopic(this, jsii.String("MyTopic")) // Lambda should receive only message matching the following conditions on attributes: // color: 'red' or 'orange' or begins with 'bl' // size: anything but 'small' or 'medium' // price: between 100 and 200 or greater than 300 // store: attribute must be present myTopic.AddSubscription(subscriptions.NewLambdaSubscription(fn, &LambdaSubscriptionProps{ FilterPolicy: map[string]subscriptionFilter{ "color": sns.*subscriptionFilter_stringFilter(&StringConditions{ "allowlist": []*string{ jsii.String("red"), jsii.String("orange"), }, "matchPrefixes": []*string{ jsii.String("bl"), }, }), "size": sns.*subscriptionFilter_stringFilter(&StringConditions{ "denylist": []*string{ jsii.String("small"), jsii.String("medium"), }, }), "price": sns.*subscriptionFilter_numericFilter(&NumericConditions{ "between": &BetweenCondition{ "start": jsii.Number(100), "stop": jsii.Number(200), }, "greaterThan": jsii.Number(300), }), "store": sns.*subscriptionFilter_existsFilter(), }, }))
type Policy ¶ added in v2.67.0
type Policy interface { FilterOrPolicy // policy argument to construct. PolicyDoc() *map[string]FilterOrPolicy // Type used in DFS buildFilterPolicyWithMessageBody to determine json value type. Type() FilterOrPolicyType // Check if instance is `Filter` type. IsFilter() *bool // Check if instance is `Policy` type. IsPolicy() *bool }
Policy Implementation of FilterOrPolicy.
Example:
// 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 filterOrPolicy filterOrPolicy policy := awscdk.Aws_sns.NewPolicy(map[string]filterOrPolicy{ "policyDocKey": filterOrPolicy, })
func FilterOrPolicy_Policy ¶ added in v2.67.0
func FilterOrPolicy_Policy(policy *map[string]FilterOrPolicy) Policy
Policy of MessageBody.
func Filter_Policy ¶ added in v2.67.0
func Filter_Policy(policy *map[string]FilterOrPolicy) Policy
Policy of MessageBody.
func NewPolicy ¶ added in v2.67.0
func NewPolicy(policyDoc *map[string]FilterOrPolicy) Policy
Policy constructor.
func Policy_Policy ¶ added in v2.67.0
func Policy_Policy(policy *map[string]FilterOrPolicy) Policy
Policy of MessageBody.
type StringConditions ¶
type StringConditions struct { // Match one or more values. Allowlist *[]*string `field:"optional" json:"allowlist" yaml:"allowlist"` // Match any value that doesn't include any of the specified values. Denylist *[]*string `field:"optional" json:"denylist" yaml:"denylist"` // Matches values that begins with the specified prefixes. MatchPrefixes *[]*string `field:"optional" json:"matchPrefixes" yaml:"matchPrefixes"` }
Conditions that can be applied to string attributes.
Example:
import lambda "github.com/aws/aws-cdk-go/awscdk" var fn function myTopic := sns.NewTopic(this, jsii.String("MyTopic")) // Lambda should receive only message matching the following conditions on attributes: // color: 'red' or 'orange' or begins with 'bl' // size: anything but 'small' or 'medium' // price: between 100 and 200 or greater than 300 // store: attribute must be present myTopic.AddSubscription(subscriptions.NewLambdaSubscription(fn, &LambdaSubscriptionProps{ FilterPolicy: map[string]subscriptionFilter{ "color": sns.*subscriptionFilter_stringFilter(&StringConditions{ "allowlist": []*string{ jsii.String("red"), jsii.String("orange"), }, "matchPrefixes": []*string{ jsii.String("bl"), }, }), "size": sns.*subscriptionFilter_stringFilter(&StringConditions{ "denylist": []*string{ jsii.String("small"), jsii.String("medium"), }, }), "price": sns.*subscriptionFilter_numericFilter(&NumericConditions{ "between": &BetweenCondition{ "start": jsii.Number(100), "stop": jsii.Number(200), }, "greaterThan": jsii.Number(300), }), "store": sns.*subscriptionFilter_existsFilter(), }, }))
type Subscription ¶
type Subscription interface { awscdk.Resource // The DLQ associated with this subscription if present. DeadLetterQueue() awssqs.IQueue // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. Env() *awscdk.ResourceEnvironment // The tree node. Node() constructs.Node // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. PhysicalName() *string // The stack in which this resource is defined. Stack() awscdk.Stack // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy) GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. GetResourceNameAttribute(nameAttr *string) *string // Returns a string representation of this construct. ToString() *string }
A new subscription.
Prefer to use the `ITopic.addSubscription()` methods to create instances of this class.
Example:
import "github.com/aws/aws-cdk-go/awscdkkinesisfirehosealpha" var stream deliveryStream topic := sns.NewTopic(this, jsii.String("Topic")) sns.NewSubscription(this, jsii.String("Subscription"), &SubscriptionProps{ Topic: Topic, Endpoint: stream.DeliveryStreamArn, Protocol: sns.SubscriptionProtocol_FIREHOSE, SubscriptionRoleArn: jsii.String("SAMPLE_ARN"), })
func NewSubscription ¶
func NewSubscription(scope constructs.Construct, id *string, props *SubscriptionProps) Subscription
type SubscriptionFilter ¶
type SubscriptionFilter interface {
// conditions that specify the message attributes that should be included, excluded, matched, etc.
Conditions() *[]interface{}
}
A subscription filter for an attribute.
Example:
import lambda "github.com/aws/aws-cdk-go/awscdk" var fn function myTopic := sns.NewTopic(this, jsii.String("MyTopic")) // Lambda should receive only message matching the following conditions on attributes: // color: 'red' or 'orange' or begins with 'bl' // size: anything but 'small' or 'medium' // price: between 100 and 200 or greater than 300 // store: attribute must be present myTopic.AddSubscription(subscriptions.NewLambdaSubscription(fn, &LambdaSubscriptionProps{ FilterPolicy: map[string]subscriptionFilter{ "color": sns.*subscriptionFilter_stringFilter(&StringConditions{ "allowlist": []*string{ jsii.String("red"), jsii.String("orange"), }, "matchPrefixes": []*string{ jsii.String("bl"), }, }), "size": sns.*subscriptionFilter_stringFilter(&StringConditions{ "denylist": []*string{ jsii.String("small"), jsii.String("medium"), }, }), "price": sns.*subscriptionFilter_numericFilter(&NumericConditions{ "between": &BetweenCondition{ "start": jsii.Number(100), "stop": jsii.Number(200), }, "greaterThan": jsii.Number(300), }), "store": sns.*subscriptionFilter_existsFilter(), }, }))
func NewSubscriptionFilter ¶
func NewSubscriptionFilter(conditions *[]interface{}) SubscriptionFilter
func SubscriptionFilter_ExistsFilter ¶
func SubscriptionFilter_ExistsFilter() SubscriptionFilter
Returns a subscription filter for attribute key matching.
func SubscriptionFilter_NumericFilter ¶
func SubscriptionFilter_NumericFilter(numericConditions *NumericConditions) SubscriptionFilter
Returns a subscription filter for a numeric attribute.
func SubscriptionFilter_StringFilter ¶
func SubscriptionFilter_StringFilter(stringConditions *StringConditions) SubscriptionFilter
Returns a subscription filter for a string attribute.
type SubscriptionOptions ¶
type SubscriptionOptions struct { // The subscription endpoint. // // The meaning of this value depends on the value for 'protocol'. Endpoint *string `field:"required" json:"endpoint" yaml:"endpoint"` // What type of subscription to add. Protocol SubscriptionProtocol `field:"required" json:"protocol" yaml:"protocol"` // Queue to be used as dead letter queue. // // If not passed no dead letter queue is enabled. DeadLetterQueue awssqs.IQueue `field:"optional" json:"deadLetterQueue" yaml:"deadLetterQueue"` // The filter policy. FilterPolicy *map[string]SubscriptionFilter `field:"optional" json:"filterPolicy" yaml:"filterPolicy"` // The filter policy that is applied on the message body. // // To apply a filter policy to the message attributes, use `filterPolicy`. A maximum of one of `filterPolicyWithMessageBody` and `filterPolicy` may be used. FilterPolicyWithMessageBody *map[string]FilterOrPolicy `field:"optional" json:"filterPolicyWithMessageBody" yaml:"filterPolicyWithMessageBody"` // true if raw message delivery is enabled for the subscription. // // Raw messages are free of JSON formatting and can be // sent to HTTP/S and Amazon SQS endpoints. For more information, see GetSubscriptionAttributes in the Amazon Simple // Notification Service API Reference. RawMessageDelivery *bool `field:"optional" json:"rawMessageDelivery" yaml:"rawMessageDelivery"` // The region where the topic resides, in the case of cross-region subscriptions. Region *string `field:"optional" json:"region" yaml:"region"` // Arn of role allowing access to firehose delivery stream. // // Required for a firehose subscription protocol. SubscriptionRoleArn *string `field:"optional" json:"subscriptionRoleArn" yaml:"subscriptionRoleArn"` }
Options for creating a new subscription.
Example:
// 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" import "github.com/aws/aws-cdk-go/awscdk" var filterOrPolicy filterOrPolicy var queue queue var subscriptionFilter subscriptionFilter subscriptionOptions := &SubscriptionOptions{ Endpoint: jsii.String("endpoint"), Protocol: awscdk.Aws_sns.SubscriptionProtocol_HTTP, // the properties below are optional DeadLetterQueue: queue, FilterPolicy: map[string]*subscriptionFilter{ "filterPolicyKey": subscriptionFilter, }, FilterPolicyWithMessageBody: map[string]*filterOrPolicy{ "filterPolicyWithMessageBodyKey": filterOrPolicy, }, RawMessageDelivery: jsii.Boolean(false), Region: jsii.String("region"), SubscriptionRoleArn: jsii.String("subscriptionRoleArn"), }
type SubscriptionProps ¶
type SubscriptionProps struct { // The subscription endpoint. // // The meaning of this value depends on the value for 'protocol'. Endpoint *string `field:"required" json:"endpoint" yaml:"endpoint"` // What type of subscription to add. Protocol SubscriptionProtocol `field:"required" json:"protocol" yaml:"protocol"` // Queue to be used as dead letter queue. // // If not passed no dead letter queue is enabled. DeadLetterQueue awssqs.IQueue `field:"optional" json:"deadLetterQueue" yaml:"deadLetterQueue"` // The filter policy. FilterPolicy *map[string]SubscriptionFilter `field:"optional" json:"filterPolicy" yaml:"filterPolicy"` // The filter policy that is applied on the message body. // // To apply a filter policy to the message attributes, use `filterPolicy`. A maximum of one of `filterPolicyWithMessageBody` and `filterPolicy` may be used. FilterPolicyWithMessageBody *map[string]FilterOrPolicy `field:"optional" json:"filterPolicyWithMessageBody" yaml:"filterPolicyWithMessageBody"` // true if raw message delivery is enabled for the subscription. // // Raw messages are free of JSON formatting and can be // sent to HTTP/S and Amazon SQS endpoints. For more information, see GetSubscriptionAttributes in the Amazon Simple // Notification Service API Reference. RawMessageDelivery *bool `field:"optional" json:"rawMessageDelivery" yaml:"rawMessageDelivery"` // The region where the topic resides, in the case of cross-region subscriptions. Region *string `field:"optional" json:"region" yaml:"region"` // Arn of role allowing access to firehose delivery stream. // // Required for a firehose subscription protocol. SubscriptionRoleArn *string `field:"optional" json:"subscriptionRoleArn" yaml:"subscriptionRoleArn"` // The topic to subscribe to. Topic ITopic `field:"required" json:"topic" yaml:"topic"` }
Properties for creating a new subscription.
Example:
import "github.com/aws/aws-cdk-go/awscdkkinesisfirehosealpha" var stream deliveryStream topic := sns.NewTopic(this, jsii.String("Topic")) sns.NewSubscription(this, jsii.String("Subscription"), &SubscriptionProps{ Topic: Topic, Endpoint: stream.DeliveryStreamArn, Protocol: sns.SubscriptionProtocol_FIREHOSE, SubscriptionRoleArn: jsii.String("SAMPLE_ARN"), })
type SubscriptionProtocol ¶
type SubscriptionProtocol string
The type of subscription, controlling the type of the endpoint parameter.
Example:
import "github.com/aws/aws-cdk-go/awscdkkinesisfirehosealpha" var stream deliveryStream topic := sns.NewTopic(this, jsii.String("Topic")) sns.NewSubscription(this, jsii.String("Subscription"), &SubscriptionProps{ Topic: Topic, Endpoint: stream.DeliveryStreamArn, Protocol: sns.SubscriptionProtocol_FIREHOSE, SubscriptionRoleArn: jsii.String("SAMPLE_ARN"), })
const ( // JSON-encoded message is POSTED to an HTTP url. SubscriptionProtocol_HTTP SubscriptionProtocol = "HTTP" // JSON-encoded message is POSTed to an HTTPS url. SubscriptionProtocol_HTTPS SubscriptionProtocol = "HTTPS" // Notifications are sent via email. SubscriptionProtocol_EMAIL SubscriptionProtocol = "EMAIL" // Notifications are JSON-encoded and sent via mail. SubscriptionProtocol_EMAIL_JSON SubscriptionProtocol = "EMAIL_JSON" // Notification is delivered by SMS. SubscriptionProtocol_SMS SubscriptionProtocol = "SMS" // Notifications are enqueued into an SQS queue. SubscriptionProtocol_SQS SubscriptionProtocol = "SQS" // JSON-encoded notifications are sent to a mobile app endpoint. SubscriptionProtocol_APPLICATION SubscriptionProtocol = "APPLICATION" // Notifications trigger a Lambda function. SubscriptionProtocol_LAMBDA SubscriptionProtocol = "LAMBDA" // Notifications put records into a firehose delivery stream. SubscriptionProtocol_FIREHOSE SubscriptionProtocol = "FIREHOSE" )
type Topic ¶
type Topic interface { TopicBase // Controls automatic creation of policy objects. // // Set by subclasses. AutoCreatePolicy() *bool // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. Env() *awscdk.ResourceEnvironment // Whether this topic is an Amazon SNS FIFO queue. // // If false, this is a standard topic. Fifo() *bool // The tree node. Node() constructs.Node // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. PhysicalName() *string // The stack in which this resource is defined. Stack() awscdk.Stack // The ARN of the topic. TopicArn() *string // The name of the topic. TopicName() *string // Subscribe some endpoint to this topic. AddSubscription(topicSubscription ITopicSubscription) Subscription // Adds a statement to the IAM resource policy associated with this topic. // // If this topic was created in this stack (`new Topic`), a topic policy // will be automatically created upon the first call to `addToPolicy`. If // the topic is imported (`Topic.import`), then this is a no-op. AddToResourcePolicy(statement awsiam.PolicyStatement) *awsiam.AddToResourcePolicyResult // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Represents a notification target That allows SNS topic to associate with this rule target. BindAsNotificationRuleTarget(_scope constructs.Construct) *awscodestarnotifications.NotificationRuleTargetConfig GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. GetResourceNameAttribute(nameAttr *string) *string // Grant topic publishing permissions to the given identity. GrantPublish(grantee awsiam.IGrantable) awsiam.Grant // Return the given named metric for this Topic. Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The number of messages published to your Amazon SNS topics. // // Sum over 5 minutes. MetricNumberOfMessagesPublished(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The number of messages successfully delivered from your Amazon SNS topics to subscribing endpoints. // // Sum over 5 minutes. MetricNumberOfNotificationsDelivered(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The number of messages that Amazon SNS failed to deliver. // // Sum over 5 minutes. MetricNumberOfNotificationsFailed(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The number of messages that were rejected by subscription filter policies. // // Sum over 5 minutes. MetricNumberOfNotificationsFilteredOut(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The number of messages that were rejected by subscription filter policies because the messages' attributes are invalid. // // Sum over 5 minutes. MetricNumberOfNotificationsFilteredOutInvalidAttributes(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The number of messages that were rejected by subscription filter policies because the messages have no attributes. // // Sum over 5 minutes. MetricNumberOfNotificationsFilteredOutNoMessageAttributes(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Metric for the size of messages published through this topic. // // Average over 5 minutes. MetricPublishSize(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The charges you have accrued since the start of the current calendar month for sending SMS messages. // // Maximum over 5 minutes. MetricSMSMonthToDateSpentUSD(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The rate of successful SMS message deliveries. // // Sum over 5 minutes. MetricSMSSuccessRate(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Returns a string representation of this construct. ToString() *string }
A new SNS topic.
Example:
import sns "github.com/aws/aws-cdk-go/awscdk" topic := sns.NewTopic(this, jsii.String("MyTopic")) topicRule := iot.NewTopicRule(this, jsii.String("TopicRule"), &TopicRuleProps{ Sql: iot.IotSql_FromStringAsVer20160323(jsii.String("SELECT topic(2) as device_id, year, month, day FROM 'device/+/data'")), Actions: []iAction{ actions.NewSnsTopicAction(topic, &SnsTopicActionProps{ MessageFormat: actions.SnsActionMessageFormat_JSON, }), }, })
func NewTopic ¶
func NewTopic(scope constructs.Construct, id *string, props *TopicProps) Topic
type TopicBase ¶
type TopicBase interface { awscdk.Resource ITopic // Controls automatic creation of policy objects. // // Set by subclasses. AutoCreatePolicy() *bool // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. Env() *awscdk.ResourceEnvironment // Whether this topic is an Amazon SNS FIFO queue. // // If false, this is a standard topic. Fifo() *bool // The tree node. Node() constructs.Node // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. PhysicalName() *string // The stack in which this resource is defined. Stack() awscdk.Stack // The ARN of the topic. TopicArn() *string // The name of the topic. TopicName() *string // Subscribe some endpoint to this topic. AddSubscription(topicSubscription ITopicSubscription) Subscription // Adds a statement to the IAM resource policy associated with this topic. // // If this topic was created in this stack (`new Topic`), a topic policy // will be automatically created upon the first call to `addToPolicy`. If // the topic is imported (`Topic.import`), then this is a no-op. AddToResourcePolicy(statement awsiam.PolicyStatement) *awsiam.AddToResourcePolicyResult // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Represents a notification target That allows SNS topic to associate with this rule target. BindAsNotificationRuleTarget(_scope constructs.Construct) *awscodestarnotifications.NotificationRuleTargetConfig GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. GetResourceNameAttribute(nameAttr *string) *string // Grant topic publishing permissions to the given identity. GrantPublish(grantee awsiam.IGrantable) awsiam.Grant // Return the given named metric for this Topic. Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The number of messages published to your Amazon SNS topics. // // Sum over 5 minutes. MetricNumberOfMessagesPublished(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The number of messages successfully delivered from your Amazon SNS topics to subscribing endpoints. // // Sum over 5 minutes. MetricNumberOfNotificationsDelivered(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The number of messages that Amazon SNS failed to deliver. // // Sum over 5 minutes. MetricNumberOfNotificationsFailed(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The number of messages that were rejected by subscription filter policies. // // Sum over 5 minutes. MetricNumberOfNotificationsFilteredOut(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The number of messages that were rejected by subscription filter policies because the messages' attributes are invalid. // // Sum over 5 minutes. MetricNumberOfNotificationsFilteredOutInvalidAttributes(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The number of messages that were rejected by subscription filter policies because the messages have no attributes. // // Sum over 5 minutes. MetricNumberOfNotificationsFilteredOutNoMessageAttributes(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Metric for the size of messages published through this topic. // // Average over 5 minutes. MetricPublishSize(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The charges you have accrued since the start of the current calendar month for sending SMS messages. // // Maximum over 5 minutes. MetricSMSMonthToDateSpentUSD(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The rate of successful SMS message deliveries. // // Sum over 5 minutes. MetricSMSSuccessRate(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Returns a string representation of this construct. ToString() *string }
Either a new or imported Topic.
type TopicPolicy ¶
type TopicPolicy interface { awscdk.Resource // The IAM policy document for this policy. Document() awsiam.PolicyDocument // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. Env() *awscdk.ResourceEnvironment // The tree node. Node() constructs.Node // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. PhysicalName() *string // The stack in which this resource is defined. Stack() awscdk.Stack // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy) GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. GetResourceNameAttribute(nameAttr *string) *string // Returns a string representation of this construct. ToString() *string }
The policy for an SNS Topic.
Policies define the operations that are allowed on this resource.
You almost never need to define this construct directly.
All AWS resources that support resource policies have a method called `addToResourcePolicy()`, which will automatically create a new resource policy if one doesn't exist yet, otherwise it will add to the existing policy.
Prefer to use `addToResourcePolicy()` instead.
Example:
topic := sns.NewTopic(this, jsii.String("Topic")) topicPolicy := sns.NewTopicPolicy(this, jsii.String("TopicPolicy"), &TopicPolicyProps{ Topics: []iTopic{ topic, }, }) topicPolicy.Document.AddStatements(iam.NewPolicyStatement(&PolicyStatementProps{ Actions: []*string{ jsii.String("sns:Subscribe"), }, Principals: []iPrincipal{ iam.NewAnyPrincipal(), }, Resources: []*string{ topic.TopicArn, }, }))
func NewTopicPolicy ¶
func NewTopicPolicy(scope constructs.Construct, id *string, props *TopicPolicyProps) TopicPolicy
type TopicPolicyProps ¶
type TopicPolicyProps struct { // The set of topics this policy applies to. Topics *[]ITopic `field:"required" json:"topics" yaml:"topics"` // IAM policy document to apply to topic(s). PolicyDocument awsiam.PolicyDocument `field:"optional" json:"policyDocument" yaml:"policyDocument"` }
Properties to associate SNS topics with a policy.
Example:
topic := sns.NewTopic(this, jsii.String("Topic")) topicPolicy := sns.NewTopicPolicy(this, jsii.String("TopicPolicy"), &TopicPolicyProps{ Topics: []iTopic{ topic, }, }) topicPolicy.Document.AddStatements(iam.NewPolicyStatement(&PolicyStatementProps{ Actions: []*string{ jsii.String("sns:Subscribe"), }, Principals: []iPrincipal{ iam.NewAnyPrincipal(), }, Resources: []*string{ topic.TopicArn, }, }))
type TopicProps ¶
type TopicProps struct { // Enables content-based deduplication for FIFO topics. ContentBasedDeduplication *bool `field:"optional" json:"contentBasedDeduplication" yaml:"contentBasedDeduplication"` // A developer-defined string that can be used to identify this SNS topic. DisplayName *string `field:"optional" json:"displayName" yaml:"displayName"` // Set to true to create a FIFO topic. Fifo *bool `field:"optional" json:"fifo" yaml:"fifo"` // A KMS Key, either managed by this CDK app, or imported. MasterKey awskms.IKey `field:"optional" json:"masterKey" yaml:"masterKey"` // A name for the topic. // // If you don't specify a name, AWS CloudFormation generates a unique // physical ID and uses that ID for the topic name. For more information, // see Name Type. TopicName *string `field:"optional" json:"topicName" yaml:"topicName"` }
Properties for a new SNS topic.
Example:
topic := sns.NewTopic(this, jsii.String("Topic"), &TopicProps{ DisplayName: jsii.String("Customer subscription topic"), })
type TopicSubscriptionConfig ¶
type TopicSubscriptionConfig struct { // The subscription endpoint. // // The meaning of this value depends on the value for 'protocol'. Endpoint *string `field:"required" json:"endpoint" yaml:"endpoint"` // What type of subscription to add. Protocol SubscriptionProtocol `field:"required" json:"protocol" yaml:"protocol"` // Queue to be used as dead letter queue. // // If not passed no dead letter queue is enabled. DeadLetterQueue awssqs.IQueue `field:"optional" json:"deadLetterQueue" yaml:"deadLetterQueue"` // The filter policy. FilterPolicy *map[string]SubscriptionFilter `field:"optional" json:"filterPolicy" yaml:"filterPolicy"` // The filter policy that is applied on the message body. // // To apply a filter policy to the message attributes, use `filterPolicy`. A maximum of one of `filterPolicyWithMessageBody` and `filterPolicy` may be used. FilterPolicyWithMessageBody *map[string]FilterOrPolicy `field:"optional" json:"filterPolicyWithMessageBody" yaml:"filterPolicyWithMessageBody"` // true if raw message delivery is enabled for the subscription. // // Raw messages are free of JSON formatting and can be // sent to HTTP/S and Amazon SQS endpoints. For more information, see GetSubscriptionAttributes in the Amazon Simple // Notification Service API Reference. RawMessageDelivery *bool `field:"optional" json:"rawMessageDelivery" yaml:"rawMessageDelivery"` // The region where the topic resides, in the case of cross-region subscriptions. Region *string `field:"optional" json:"region" yaml:"region"` // Arn of role allowing access to firehose delivery stream. // // Required for a firehose subscription protocol. SubscriptionRoleArn *string `field:"optional" json:"subscriptionRoleArn" yaml:"subscriptionRoleArn"` // The id of the SNS subscription resource created under `scope`. // // In most // cases, it is recommended to use the `uniqueId` of the topic you are // subscribing to. SubscriberId *string `field:"required" json:"subscriberId" yaml:"subscriberId"` // The scope in which to create the SNS subscription resource. // // Normally you'd // want the subscription to be created on the consuming stack because the // topic is usually referenced by the consumer's resource policy (e.g. SQS // queue policy). Otherwise, it will cause a cyclic reference. // // If this is undefined, the subscription will be created on the topic's stack. SubscriberScope constructs.Construct `field:"optional" json:"subscriberScope" yaml:"subscriberScope"` // The resources that need to be created before the subscription can be safely created. // // For example for SQS subscription, the subscription needs to have a dependency on the SQS queue policy // in order for the subscription to successfully deliver messages. SubscriptionDependency constructs.IDependable `field:"optional" json:"subscriptionDependency" yaml:"subscriptionDependency"` }
Subscription configuration.
Example:
// 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" import "github.com/aws/aws-cdk-go/awscdk" import constructs "github.com/aws/constructs-go/constructs" var construct construct var dependable iDependable var filterOrPolicy filterOrPolicy var queue queue var subscriptionFilter subscriptionFilter topicSubscriptionConfig := &TopicSubscriptionConfig{ Endpoint: jsii.String("endpoint"), Protocol: awscdk.Aws_sns.SubscriptionProtocol_HTTP, SubscriberId: jsii.String("subscriberId"), // the properties below are optional DeadLetterQueue: queue, FilterPolicy: map[string]*subscriptionFilter{ "filterPolicyKey": subscriptionFilter, }, FilterPolicyWithMessageBody: map[string]*filterOrPolicy{ "filterPolicyWithMessageBodyKey": filterOrPolicy, }, RawMessageDelivery: jsii.Boolean(false), Region: jsii.String("region"), SubscriberScope: construct, SubscriptionDependency: dependable, SubscriptionRoleArn: jsii.String("subscriptionRoleArn"), }
Source Files ¶
- BetweenCondition.go
- CfnSubscription.go
- CfnSubscriptionProps.go
- CfnSubscription__checks.go
- CfnTopic.go
- CfnTopicPolicy.go
- CfnTopicPolicyProps.go
- CfnTopicPolicy__checks.go
- CfnTopicProps.go
- CfnTopic_SubscriptionProperty.go
- CfnTopic__checks.go
- Filter.go
- FilterOrPolicy.go
- FilterOrPolicyType.go
- FilterOrPolicy__checks.go
- Filter__checks.go
- ITopic.go
- ITopicSubscription.go
- ITopicSubscription__checks.go
- ITopic__checks.go
- NumericConditions.go
- Policy.go
- Policy__checks.go
- StringConditions.go
- Subscription.go
- SubscriptionFilter.go
- SubscriptionFilter__checks.go
- SubscriptionOptions.go
- SubscriptionProps.go
- SubscriptionProtocol.go
- Subscription__checks.go
- Topic.go
- TopicBase.go
- TopicBase__checks.go
- TopicPolicy.go
- TopicPolicyProps.go
- TopicPolicy__checks.go
- TopicProps.go
- TopicSubscriptionConfig.go
- Topic__checks.go
- main.go