awssns

package
v2.139.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 12 Imported by: 34

README

Amazon Simple Notification Service Construct Library

Add an SNS Topic to your stack:

topic := sns.NewTopic(this, jsii.String("Topic"), &TopicProps{
	DisplayName: jsii.String("Customer subscription topic"),
})

Add a FIFO SNS topic with content-based de-duplication to your stack:

topic := sns.NewTopic(this, jsii.String("Topic"), &TopicProps{
	ContentBasedDeduplication: jsii.Boolean(true),
	DisplayName: jsii.String("Customer subscription topic"),
	Fifo: jsii.Boolean(true),
})

Add an SNS Topic to your stack with a specified signature version, which corresponds to the hashing algorithm used while creating the signature of the notifications, subscription confirmations, or unsubscribe confirmation messages sent by Amazon SNS.

The default signature version is 1 (SHA1). SNS also supports signature version 2 (SHA256).

topic := sns.NewTopic(this, jsii.String("Topic"), &TopicProps{
	SignatureVersion: jsii.String("2"),
})

Note that FIFO topics require a topic name to be provided. The required .fifo suffix will be automatically generated and added to the topic name if it is not explicitly provided.

Subscriptions

Various subscriptions can be added to the topic by calling the .addSubscription(...) method on the topic. It accepts a subscription object, default implementations of which can be found in the aws-cdk-lib/aws-sns-subscriptions package:

Add an HTTPS Subscription to your topic:

myTopic := sns.NewTopic(this, jsii.String("MyTopic"))

myTopic.AddSubscription(subscriptions.NewUrlSubscription(jsii.String("https://foobar.com/")))

Subscribe a queue to the topic:

var queue queue

myTopic := sns.NewTopic(this, jsii.String("MyTopic"))

myTopic.AddSubscription(subscriptions.NewSqsSubscription(queue))

Note that subscriptions of queues in different accounts need to be manually confirmed by reading the initial message from the queue and visiting the link found in it.

Filter policy

A filter policy can be specified when subscribing an endpoint to a topic.

Example with a Lambda subscription:

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"),
			},
			"matchSuffixes": []*string{
				jsii.String("ue"),
			},
		}),
		"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(),
	},
}))
Payload-based filtering

To filter messages based on the payload or body of the message, use the filterPolicyWithMessageBody property. This type of filter policy supports creating filters on nested objects.

Example with a Lambda subscription:

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"),
				},
			})),
		}),
	},
}))
Example of Firehose Subscription
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"),
})

DLQ setup for SNS Subscription

CDK can attach provided Queue as DLQ for your SNS subscription. See the SNS DLQ configuration docs for more information about this feature.

Example of usage with user provided DLQ.

topic := sns.NewTopic(this, jsii.String("Topic"))
dlQueue := sqs.NewQueue(this, jsii.String("DeadLetterQueue"), &QueueProps{
	QueueName: jsii.String("MySubscription_DLQ"),
	RetentionPeriod: awscdk.Duration_Days(jsii.Number(14)),
})

sns.NewSubscription(this, jsii.String("Subscription"), &SubscriptionProps{
	Endpoint: jsii.String("endpoint"),
	Protocol: sns.SubscriptionProtocol_LAMBDA,
	Topic: Topic,
	DeadLetterQueue: dlQueue,
})

CloudWatch Event Rule Target

SNS topics can be used as targets for CloudWatch event rules.

Use the aws-cdk-lib/aws-events-targets.SnsTopic:

import codecommit "github.com/aws/aws-cdk-go/awscdk"
import targets "github.com/aws/aws-cdk-go/awscdk"

var repo repository

myTopic := sns.NewTopic(this, jsii.String("Topic"))

repo.onCommit(jsii.String("OnCommit"), &OnCommitOptions{
	Target: targets.NewSnsTopic(myTopic),
})

This will result in adding a target to the event rule and will also modify the topic resource policy to allow CloudWatch events to publish to the topic.

Topic Policy

A topic policy is automatically created when addToResourcePolicy is called, if one doesn't already exist. Using addToResourcePolicy is the simplest way to add policies, but a TopicPolicy can also be created manually.

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,
	},
}))

A policy document can also be passed on TopicPolicy construction

topic := sns.NewTopic(this, jsii.String("Topic"))
policyDocument := iam.NewPolicyDocument(&PolicyDocumentProps{
	AssignSids: jsii.Boolean(true),
	Statements: []policyStatement{
		iam.NewPolicyStatement(&PolicyStatementProps{
			Actions: []*string{
				jsii.String("sns:Subscribe"),
			},
			Principals: []iPrincipal{
				iam.NewAnyPrincipal(),
			},
			Resources: []*string{
				topic.TopicArn,
			},
		}),
	},
})

topicPolicy := sns.NewTopicPolicy(this, jsii.String("Policy"), &TopicPolicyProps{
	Topics: []iTopic{
		topic,
	},
	PolicyDocument: PolicyDocument,
})
Enforce encryption of data in transit when publishing to a topic

You can enforce SSL when creating a topic policy by setting the enforceSSL flag:

topic := sns.NewTopic(this, jsii.String("Topic"))
policyDocument := iam.NewPolicyDocument(&PolicyDocumentProps{
	AssignSids: jsii.Boolean(true),
	Statements: []policyStatement{
		iam.NewPolicyStatement(&PolicyStatementProps{
			Actions: []*string{
				jsii.String("sns:Publish"),
			},
			Principals: []iPrincipal{
				iam.NewServicePrincipal(jsii.String("s3.amazonaws.com")),
			},
			Resources: []*string{
				topic.TopicArn,
			},
		}),
	},
})

topicPolicy := sns.NewTopicPolicy(this, jsii.String("Policy"), &TopicPolicyProps{
	Topics: []iTopic{
		topic,
	},
	PolicyDocument: PolicyDocument,
	EnforceSSL: jsii.Boolean(true),
})

Similiarly you can enforce SSL by setting the enforceSSL flag on the topic:

topic := sns.NewTopic(this, jsii.String("TopicAddPolicy"), &TopicProps{
	EnforceSSL: jsii.Boolean(true),
})

topic.AddToResourcePolicy(iam.NewPolicyStatement(&PolicyStatementProps{
	Principals: []iPrincipal{
		iam.NewServicePrincipal(jsii.String("s3.amazonaws.com")),
	},
	Actions: []*string{
		jsii.String("sns:Publish"),
	},
	Resources: []*string{
		topic.TopicArn,
	},
}))

Delivery status logging

Amazon SNS provides support to log the delivery status of notification messages sent to topics with the following Amazon SNS endpoints:

  • HTTP
  • Amazon Kinesis Data Firehose
  • AWS Lambda
  • Platform application endpoint
  • Amazon Simple Queue Service

Example with a delivery status logging configuration for SQS:

var role role

topic := sns.NewTopic(this, jsii.String("MyTopic"), &TopicProps{
	LoggingConfigs: []loggingConfig{
		&loggingConfig{
			Protocol: sns.LoggingProtocol_SQS,
			FailureFeedbackRole: role,
			SuccessFeedbackRole: role,
			SuccessFeedbackSampleRate: jsii.Number(50),
		},
	},
})

A delivery status logging configuration can also be added to your topic by addLoggingConfig method:

var role role

topic := sns.NewTopic(this, jsii.String("MyTopic"))

topic.AddLoggingConfig(&LoggingConfig{
	Protocol: sns.LoggingProtocol_SQS,
	FailureFeedbackRole: role,
	SuccessFeedbackRole: role,
	SuccessFeedbackSampleRate: jsii.Number(50),
})

Note that valid values for successFeedbackSampleRate are integer between 0-100.

Archive Policy

Message archiving provides the ability to archive a single copy of all messages published to your topic. You can store published messages within your topic by enabling the message archive policy on the topic, which enables message archiving for all subscriptions linked to that topic. Messages can be archived for a minimum of one day to a maximum of 365 days.

Example with an archive policy:

topic := sns.NewTopic(this, jsii.String("MyTopic"), &TopicProps{
	Fifo: jsii.Boolean(true),
	MessageRetentionPeriodInDays: jsii.Number(7),
})

Note: The messageRetentionPeriodInDays property is only available for FIFO topics.

TracingConfig

Tracing mode of an Amazon SNS topic.

If PassThrough, the topic passes trace headers received from the Amazon SNS publisher to its subscription. If set to Active, Amazon SNS will vend X-Ray segment data to topic owner account if the sampled flag in the tracing header is true.

The default TracingConfig is TracingConfig.PASS_THROUGH.

Example with a tracingConfig set to Active:

topic := sns.NewTopic(this, jsii.String("MyTopic"), &TopicProps{
	TracingConfig: sns.TracingConfig_ACTIVE,
})

Documentation

Index

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(x interface{}) *bool

Check whether the given object 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 CfnTopicInlinePolicy_CFN_RESOURCE_TYPE_NAME added in v2.89.0

func CfnTopicInlinePolicy_CFN_RESOURCE_TYPE_NAME() *string

func CfnTopicInlinePolicy_IsCfnElement added in v2.89.0

func CfnTopicInlinePolicy_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 CfnTopicInlinePolicy_IsCfnResource added in v2.89.0

func CfnTopicInlinePolicy_IsCfnResource(x interface{}) *bool

Check whether the given object is a CfnResource.

func CfnTopicInlinePolicy_IsConstruct added in v2.89.0

func CfnTopicInlinePolicy_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(x interface{}) *bool

Check whether the given object 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(x interface{}) *bool

Check whether the given object 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)

func NewCfnTopicInlinePolicy_Override added in v2.89.0

func NewCfnTopicInlinePolicy_Override(c CfnTopicInlinePolicy, scope constructs.Construct, id *string, props *CfnTopicInlinePolicyProps)

func NewCfnTopicPolicy_Override

func NewCfnTopicPolicy_Override(c CfnTopicPolicy, scope constructs.Construct, id *string, props *CfnTopicPolicyProps)

func NewCfnTopic_Override

func NewCfnTopic_Override(c CfnTopic, scope constructs.Construct, id *string, props *CfnTopicProps)

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 NewTopicBase_Override(t TopicBase, scope constructs.Construct, id *string, props *awscdk.ResourceProps)

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"),
			},
			"matchSuffixes": []*string{
				jsii.String("ue"),
			},
		}),
		"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
	AttrId() *string
	// 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.
	DeliveryPolicy() interface{}
	SetDeliveryPolicy(val interface{})
	// The subscription's endpoint.
	Endpoint() *string
	SetEndpoint(val *string)
	// The filter policy JSON assigned to the subscription.
	FilterPolicy() interface{}
	SetFilterPolicy(val interface{})
	// This attribute lets you choose the filtering scope by using one of the following string value types:.
	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.
	Protocol() *string
	SetProtocol(val *string)
	// When set to `true` , enables raw message delivery.
	RawMessageDelivery() interface{}
	SetRawMessageDelivery(val interface{})
	// When specified, sends undeliverable messages to the specified Amazon SQS dead-letter queue.
	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.
	Region() *string
	SetRegion(val *string)
	ReplayPolicy() interface{}
	SetReplayPolicy(val interface{})
	// 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 Data Firehose delivery stream subscriptions.
	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{})
}

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{}
var replayPolicy 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"),
	ReplayPolicy: replayPolicy,
	SubscriptionRoleArn: jsii.String("subscriptionRoleArn"),
})

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-subscription.html

func NewCfnSubscription

func NewCfnSubscription(scope constructs.Construct, id *string, props *CfnSubscriptionProps) CfnSubscription

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* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-subscription.html#cfn-sns-subscription-protocol
	//
	Protocol *string `field:"required" json:"protocol" yaml:"protocol"`
	// The ARN of the topic to subscribe to.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-subscription.html#cfn-sns-subscription-topicarn
	//
	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* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-subscription.html#cfn-sns-subscription-deliverypolicy
	//
	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* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-subscription.html#cfn-sns-subscription-endpoint
	//
	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* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-subscription.html#cfn-sns-subscription-filterpolicy
	//
	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.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-subscription.html#cfn-sns-subscription-filterpolicyscope
	//
	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* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-subscription.html#cfn-sns-subscription-rawmessagedelivery
	//
	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* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-subscription.html#cfn-sns-subscription-redrivepolicy
	//
	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` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-subscription.html#cfn-sns-subscription-region
	//
	Region *string `field:"optional" json:"region" yaml:"region"`
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-subscription.html#cfn-sns-subscription-replaypolicy
	//
	ReplayPolicy interface{} `field:"optional" json:"replayPolicy" yaml:"replayPolicy"`
	// This property applies only to Amazon Data Firehose delivery stream subscriptions.
	//
	// Specify the ARN of the IAM role that has the following:
	//
	// - Permission to write to the Amazon Data Firehose delivery stream
	// - Amazon SNS listed as a trusted entity
	//
	// Specifying a valid ARN for this attribute is required for Firehose delivery stream subscriptions. For more information, see [Fanout to Amazon Data Firehose delivery streams](https://docs.aws.amazon.com/sns/latest/dg/sns-firehose-as-subscriber.html) in the *Amazon SNS Developer Guide.*
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-subscription.html#cfn-sns-subscription-subscriptionrolearn
	//
	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{}
var replayPolicy 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"),
	ReplayPolicy: replayPolicy,
	SubscriptionRoleArn: jsii.String("subscriptionRoleArn"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-subscription.html

type CfnTopic

type CfnTopic interface {
	awscdk.CfnResource
	awscdk.IInspectable
	awscdk.ITaggable
	// The archive policy determines the number of days Amazon SNS retains messages.
	ArchivePolicy() interface{}
	SetArchivePolicy(val interface{})
	// 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.
	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.
	DataProtectionPolicy() interface{}
	SetDataProtectionPolicy(val interface{})
	// The `DeliveryStatusLogging` configuration enables you to log the delivery status of messages sent from your Amazon SNS topic to subscribed endpoints with the following supported delivery protocols:.
	DeliveryStatusLogging() interface{}
	SetDeliveryStatusLogging(val interface{})
	// The display name to use for an Amazon SNS topic with SMS subscriptions.
	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.
	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.
	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.
	Subscription() interface{}
	SetSubscription(val interface{})
	// Tag Manager which manages the tags for this resource.
	Tags() awscdk.TagManager
	// The list of tags to add to a new topic.
	TagsRaw() *[]*awscdk.CfnTag
	SetTagsRaw(val *[]*awscdk.CfnTag)
	// The name of the topic you want to create.
	TopicName() *string
	SetTopicName(val *string)
	// Tracing mode of an Amazon SNS topic.
	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{})
}

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 archivePolicy interface{}
var dataProtectionPolicy interface{}

cfnTopic := awscdk.Aws_sns.NewCfnTopic(this, jsii.String("MyCfnTopic"), &CfnTopicProps{
	ArchivePolicy: archivePolicy,
	ContentBasedDeduplication: jsii.Boolean(false),
	DataProtectionPolicy: dataProtectionPolicy,
	DeliveryStatusLogging: []interface{}{
		&LoggingConfigProperty{
			Protocol: jsii.String("protocol"),

			// the properties below are optional
			FailureFeedbackRoleArn: jsii.String("failureFeedbackRoleArn"),
			SuccessFeedbackRoleArn: jsii.String("successFeedbackRoleArn"),
			SuccessFeedbackSampleRate: jsii.String("successFeedbackSampleRate"),
		},
	},
	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"),
})

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topic.html

func NewCfnTopic

func NewCfnTopic(scope constructs.Construct, id *string, props *CfnTopicProps) CfnTopic

type CfnTopicInlinePolicy added in v2.89.0

type CfnTopicInlinePolicy 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 Amazon SNS topic.
	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 Name (ARN) of the topic to which you want to add the policy.
	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{})
}

The `AWS::SNS::TopicInlinePolicy` resource associates one Amazon SNS topic with one policy.

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{}

cfnTopicInlinePolicy := awscdk.Aws_sns.NewCfnTopicInlinePolicy(this, jsii.String("MyCfnTopicInlinePolicy"), &CfnTopicInlinePolicyProps{
	PolicyDocument: policyDocument,
	TopicArn: jsii.String("topicArn"),
})

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topicinlinepolicy.html

func NewCfnTopicInlinePolicy added in v2.89.0

func NewCfnTopicInlinePolicy(scope constructs.Construct, id *string, props *CfnTopicInlinePolicyProps) CfnTopicInlinePolicy

type CfnTopicInlinePolicyProps added in v2.89.0

type CfnTopicInlinePolicyProps struct {
	// A policy document that contains permissions to add to the specified Amazon SNS topic.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topicinlinepolicy.html#cfn-sns-topicinlinepolicy-policydocument
	//
	PolicyDocument interface{} `field:"required" json:"policyDocument" yaml:"policyDocument"`
	// The Amazon Resource Name (ARN) of the topic to which you want to add the policy.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topicinlinepolicy.html#cfn-sns-topicinlinepolicy-topicarn
	//
	TopicArn *string `field:"required" json:"topicArn" yaml:"topicArn"`
}

Properties for defining a `CfnTopicInlinePolicy`.

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{}

cfnTopicInlinePolicyProps := &CfnTopicInlinePolicyProps{
	PolicyDocument: policyDocument,
	TopicArn: jsii.String("topicArn"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topicinlinepolicy.html

type CfnTopicPolicy

type CfnTopicPolicy interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// The provider-assigned unique ID for this managed resource.
	AttrId() *string
	// 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.
	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{})
}

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"),
	},
})

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topicpolicy.html

func NewCfnTopicPolicy

func NewCfnTopicPolicy(scope constructs.Construct, id *string, props *CfnTopicPolicyProps) CfnTopicPolicy

type CfnTopicPolicyProps

type CfnTopicPolicyProps struct {
	// A policy document that contains permissions to add to the specified SNS topics.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topicpolicy.html#cfn-sns-topicpolicy-policydocument
	//
	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.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topicpolicy.html#cfn-sns-topicpolicy-topics
	//
	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"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topicpolicy.html

type CfnTopicProps

type CfnTopicProps struct {
	// The archive policy determines the number of days Amazon SNS retains messages.
	//
	// You can set a retention period from 1 to 365 days.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topic.html#cfn-sns-topic-archivepolicy
	//
	ArchivePolicy interface{} `field:"optional" json:"archivePolicy" yaml:"archivePolicy"`
	// 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.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topic.html#cfn-sns-topic-contentbaseddeduplication
	//
	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.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topic.html#cfn-sns-topic-dataprotectionpolicy
	//
	DataProtectionPolicy interface{} `field:"optional" json:"dataProtectionPolicy" yaml:"dataProtectionPolicy"`
	// The `DeliveryStatusLogging` configuration enables you to log the delivery status of messages sent from your Amazon SNS topic to subscribed endpoints with the following supported delivery protocols:.
	//
	// - HTTP
	// - Amazon Kinesis Data Firehose
	// - AWS Lambda
	// - Platform application endpoint
	// - Amazon Simple Queue Service
	//
	// Once configured, log entries are sent to Amazon CloudWatch Logs.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topic.html#cfn-sns-topic-deliverystatuslogging
	//
	DeliveryStatusLogging interface{} `field:"optional" json:"deliveryStatusLogging" yaml:"deliveryStatusLogging"`
	// 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.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topic.html#cfn-sns-topic-displayname
	//
	DisplayName *string `field:"optional" json:"displayName" yaml:"displayName"`
	// Set to true to create a FIFO topic.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topic.html#cfn-sns-topic-fifotopic
	//
	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) .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topic.html#cfn-sns-topic-kmsmasterkeyid
	//
	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` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topic.html#cfn-sns-topic-signatureversion
	//
	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.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topic.html#cfn-sns-topic-subscription
	//
	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.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topic.html#cfn-sns-topic-tags
	//
	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.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topic.html#cfn-sns-topic-topicname
	//
	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 Amazon SNS publisher to its subscriptions. If set to `Active` , Amazon SNS will vend X-Ray segment data to topic owner account if the sampled flag in the tracing header is true.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topic.html#cfn-sns-topic-tracingconfig
	//
	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 archivePolicy interface{}
var dataProtectionPolicy interface{}

cfnTopicProps := &CfnTopicProps{
	ArchivePolicy: archivePolicy,
	ContentBasedDeduplication: jsii.Boolean(false),
	DataProtectionPolicy: dataProtectionPolicy,
	DeliveryStatusLogging: []interface{}{
		&LoggingConfigProperty{
			Protocol: jsii.String("protocol"),

			// the properties below are optional
			FailureFeedbackRoleArn: jsii.String("failureFeedbackRoleArn"),
			SuccessFeedbackRoleArn: jsii.String("successFeedbackRoleArn"),
			SuccessFeedbackSampleRate: jsii.String("successFeedbackSampleRate"),
		},
	},
	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"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topic.html

type CfnTopic_LoggingConfigProperty added in v2.115.0

type CfnTopic_LoggingConfigProperty struct {
	// Indicates one of the supported protocols for the Amazon SNS topic.
	//
	// > At least one of the other three `LoggingConfig` properties is recommend along with `Protocol` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sns-topic-loggingconfig.html#cfn-sns-topic-loggingconfig-protocol
	//
	Protocol *string `field:"required" json:"protocol" yaml:"protocol"`
	// The IAM role ARN to be used when logging failed message deliveries in Amazon CloudWatch.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sns-topic-loggingconfig.html#cfn-sns-topic-loggingconfig-failurefeedbackrolearn
	//
	FailureFeedbackRoleArn *string `field:"optional" json:"failureFeedbackRoleArn" yaml:"failureFeedbackRoleArn"`
	// The IAM role ARN to be used when logging successful message deliveries in Amazon CloudWatch.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sns-topic-loggingconfig.html#cfn-sns-topic-loggingconfig-successfeedbackrolearn
	//
	SuccessFeedbackRoleArn *string `field:"optional" json:"successFeedbackRoleArn" yaml:"successFeedbackRoleArn"`
	// The percentage of successful message deliveries to be logged in Amazon CloudWatch.
	//
	// Valid percentage values range from 0 to 100.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sns-topic-loggingconfig.html#cfn-sns-topic-loggingconfig-successfeedbacksamplerate
	//
	SuccessFeedbackSampleRate *string `field:"optional" json:"successFeedbackSampleRate" yaml:"successFeedbackSampleRate"`
}

The `LoggingConfig` property type specifies the `Delivery` status logging configuration for an [`AWS::SNS::Topic`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topic.html) .

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"

loggingConfigProperty := &LoggingConfigProperty{
	Protocol: jsii.String("protocol"),

	// the properties below are optional
	FailureFeedbackRoleArn: jsii.String("failureFeedbackRoleArn"),
	SuccessFeedbackRoleArn: jsii.String("successFeedbackRoleArn"),
	SuccessFeedbackSampleRate: jsii.String("successFeedbackSampleRate"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sns-topic-loggingconfig.html

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* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sns-topic-subscription.html#cfn-sns-topic-subscription-endpoint
	//
	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* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sns-topic-subscription.html#cfn-sns-topic-subscription-protocol
	//
	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"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sns-topic-subscription.html

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 `addToResourcePolicy`. 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
	// Enables content-based deduplication for FIFO topics.
	ContentBasedDeduplication() *bool
	// 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

func Topic_FromTopicArn(scope constructs.Construct, id *string, topicArn *string) ITopic

Import an existing SNS topic provided an ARN.

func Topic_FromTopicAttributes added in v2.137.0

func Topic_FromTopicAttributes(scope constructs.Construct, id *string, attrs *TopicAttributes) ITopic

Import an existing SNS topic provided a topic attributes.

type ITopicSubscription

type ITopicSubscription interface {
	// Returns a configuration used to subscribe to an SNS topic.
	Bind(topic ITopic) *TopicSubscriptionConfig
}

Topic subscription.

type LoggingConfig added in v2.116.0

type LoggingConfig struct {
	// Indicates one of the supported protocols for the SNS topic.
	Protocol LoggingProtocol `field:"required" json:"protocol" yaml:"protocol"`
	// The IAM role to be used when logging failed message deliveries in Amazon CloudWatch.
	// Default: None.
	//
	FailureFeedbackRole awsiam.IRole `field:"optional" json:"failureFeedbackRole" yaml:"failureFeedbackRole"`
	// The IAM role to be used when logging successful message deliveries in Amazon CloudWatch.
	// Default: None.
	//
	SuccessFeedbackRole awsiam.IRole `field:"optional" json:"successFeedbackRole" yaml:"successFeedbackRole"`
	// The percentage of successful message deliveries to be logged in Amazon CloudWatch.
	//
	// Valid values are integer between 0-100.
	// Default: None.
	//
	SuccessFeedbackSampleRate *float64 `field:"optional" json:"successFeedbackSampleRate" yaml:"successFeedbackSampleRate"`
}

A logging configuration for delivery status of messages sent from SNS topic to subscribed endpoints.

Example:

var role role

topic := sns.NewTopic(this, jsii.String("MyTopic"))

topic.AddLoggingConfig(&LoggingConfig{
	Protocol: sns.LoggingProtocol_SQS,
	FailureFeedbackRole: role,
	SuccessFeedbackRole: role,
	SuccessFeedbackSampleRate: jsii.Number(50),
})

See: https://docs.aws.amazon.com/sns/latest/dg/sns-topic-attributes.html.

type LoggingProtocol added in v2.116.0

type LoggingProtocol string

The type of supported protocol for delivery status logging.

Example:

var role role

topic := sns.NewTopic(this, jsii.String("MyTopic"), &TopicProps{
	LoggingConfigs: []loggingConfig{
		&loggingConfig{
			Protocol: sns.LoggingProtocol_SQS,
			FailureFeedbackRole: role,
			SuccessFeedbackRole: role,
			SuccessFeedbackSampleRate: jsii.Number(50),
		},
	},
})
const (
	// HTTP.
	LoggingProtocol_HTTP LoggingProtocol = "HTTP"
	// Amazon Simple Queue Service.
	LoggingProtocol_SQS LoggingProtocol = "SQS"
	// AWS Lambda.
	LoggingProtocol_LAMBDA LoggingProtocol = "LAMBDA"
	// Amazon Kinesis Data Firehose.
	LoggingProtocol_FIREHOSE LoggingProtocol = "FIREHOSE"
	// Platform application endpoint.
	LoggingProtocol_APPLICATION LoggingProtocol = "APPLICATION"
)

type NumericConditions

type NumericConditions struct {
	// Match one or more values.
	// Default: - None.
	//
	Allowlist *[]*float64 `field:"optional" json:"allowlist" yaml:"allowlist"`
	// Match values that are between the specified values.
	// Default: - None.
	//
	Between *BetweenCondition `field:"optional" json:"between" yaml:"between"`
	// Match values that are strictly between the specified values.
	// Default: - None.
	//
	BetweenStrict *BetweenCondition `field:"optional" json:"betweenStrict" yaml:"betweenStrict"`
	// Match values that are greater than the specified value.
	// Default: - None.
	//
	GreaterThan *float64 `field:"optional" json:"greaterThan" yaml:"greaterThan"`
	// Match values that are greater than or equal to the specified value.
	// Default: - None.
	//
	GreaterThanOrEqualTo *float64 `field:"optional" json:"greaterThanOrEqualTo" yaml:"greaterThanOrEqualTo"`
	// Match values that are less than the specified value.
	// Default: - None.
	//
	LessThan *float64 `field:"optional" json:"lessThan" yaml:"lessThan"`
	// Match values that are less than or equal to the specified value.
	// Default: - None.
	//
	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"),
			},
			"matchSuffixes": []*string{
				jsii.String("ue"),
			},
		}),
		"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.
	// Default: - None.
	//
	Allowlist *[]*string `field:"optional" json:"allowlist" yaml:"allowlist"`
	// Match any value that doesn't include any of the specified values.
	// Default: - None.
	//
	Denylist *[]*string `field:"optional" json:"denylist" yaml:"denylist"`
	// Matches values that begins with the specified prefixes.
	// Default: - None.
	//
	MatchPrefixes *[]*string `field:"optional" json:"matchPrefixes" yaml:"matchPrefixes"`
	// Matches values that end with the specified suffixes.
	// Default: - None.
	//
	MatchSuffixes *[]*string `field:"optional" json:"matchSuffixes" yaml:"matchSuffixes"`
}

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"),
			},
			"matchSuffixes": []*string{
				jsii.String("ue"),
			},
		}),
		"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"),
			},
			"matchSuffixes": []*string{
				jsii.String("ue"),
			},
		}),
		"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.
	// Default: - No dead letter queue enabled.
	//
	DeadLetterQueue awssqs.IQueue `field:"optional" json:"deadLetterQueue" yaml:"deadLetterQueue"`
	// The filter policy.
	// Default: - all messages are delivered.
	//
	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.
	// Default: - all messages are delivered.
	//
	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.
	// Default: false.
	//
	RawMessageDelivery *bool `field:"optional" json:"rawMessageDelivery" yaml:"rawMessageDelivery"`
	// The region where the topic resides, in the case of cross-region subscriptions.
	// Default: - the region where the CloudFormation stack is being deployed.
	//
	Region *string `field:"optional" json:"region" yaml:"region"`
	// Arn of role allowing access to firehose delivery stream.
	//
	// Required for a firehose subscription protocol.
	// Default: - No subscription role is provided.
	//
	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.
	// Default: - No dead letter queue enabled.
	//
	DeadLetterQueue awssqs.IQueue `field:"optional" json:"deadLetterQueue" yaml:"deadLetterQueue"`
	// The filter policy.
	// Default: - all messages are delivered.
	//
	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.
	// Default: - all messages are delivered.
	//
	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.
	// Default: false.
	//
	RawMessageDelivery *bool `field:"optional" json:"rawMessageDelivery" yaml:"rawMessageDelivery"`
	// The region where the topic resides, in the case of cross-region subscriptions.
	// Default: - the region where the CloudFormation stack is being deployed.
	//
	Region *string `field:"optional" json:"region" yaml:"region"`
	// Arn of role allowing access to firehose delivery stream.
	//
	// Required for a firehose subscription protocol.
	// Default: - No subscription role is provided.
	//
	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
	// Enables content-based deduplication for FIFO topics.
	ContentBasedDeduplication() *bool
	// Adds a statement to enforce encryption of data in transit when publishing to the topic.
	EnforceSSL() *bool
	SetEnforceSSL(val *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
	// Adds a delivery status logging configuration to the topic.
	AddLoggingConfig(config *LoggingConfig)
	// 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 `addToResourcePolicy`. 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
	// Adds a statement to enforce encryption of data in transit when publishing to the topic.
	//
	// For more information, see https://docs.aws.amazon.com/sns/latest/dg/sns-security-best-practices.html#enforce-encryption-data-in-transit.
	CreateSSLPolicyDocument() awsiam.PolicyStatement
	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 TopicAttributes added in v2.137.0

type TopicAttributes struct {
	// The ARN of the SNS topic.
	TopicArn *string `field:"required" json:"topicArn" yaml:"topicArn"`
	// Whether content-based deduplication is enabled.
	//
	// Only applicable for FIFO topics.
	// Default: false.
	//
	ContentBasedDeduplication *bool `field:"optional" json:"contentBasedDeduplication" yaml:"contentBasedDeduplication"`
}

Represents an SNS topic defined outside of this stack.

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"

topicAttributes := &TopicAttributes{
	TopicArn: jsii.String("topicArn"),

	// the properties below are optional
	ContentBasedDeduplication: jsii.Boolean(false),
}

type TopicBase

type TopicBase interface {
	awscdk.Resource
	ITopic
	// Controls automatic creation of policy objects.
	//
	// Set by subclasses.
	AutoCreatePolicy() *bool
	// Enables content-based deduplication for FIFO topics.
	ContentBasedDeduplication() *bool
	// Adds a statement to enforce encryption of data in transit when publishing to the topic.
	EnforceSSL() *bool
	SetEnforceSSL(val *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 `addToResourcePolicy`. 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
	// Adds a statement to enforce encryption of data in transit when publishing to the topic.
	//
	// For more information, see https://docs.aws.amazon.com/sns/latest/dg/sns-security-best-practices.html#enforce-encryption-data-in-transit.
	CreateSSLPolicyDocument() awsiam.PolicyStatement
	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)
	// Adds a statement to enforce encryption of data in transit when publishing to the topic.
	//
	// For more information, see https://docs.aws.amazon.com/sns/latest/dg/sns-security-best-practices.html#enforce-encryption-data-in-transit.
	CreateSSLPolicyDocument(topicArn *string) awsiam.PolicyStatement
	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"))
policyDocument := iam.NewPolicyDocument(&PolicyDocumentProps{
	AssignSids: jsii.Boolean(true),
	Statements: []policyStatement{
		iam.NewPolicyStatement(&PolicyStatementProps{
			Actions: []*string{
				jsii.String("sns:Subscribe"),
			},
			Principals: []iPrincipal{
				iam.NewAnyPrincipal(),
			},
			Resources: []*string{
				topic.TopicArn,
			},
		}),
	},
})

topicPolicy := sns.NewTopicPolicy(this, jsii.String("Policy"), &TopicPolicyProps{
	Topics: []iTopic{
		topic,
	},
	PolicyDocument: PolicyDocument,
})

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"`
	// Adds a statement to enforce encryption of data in transit when publishing to the topic.
	//
	// For more information, see https://docs.aws.amazon.com/sns/latest/dg/sns-security-best-practices.html#enforce-encryption-data-in-transit.
	// Default: false.
	//
	EnforceSSL *bool `field:"optional" json:"enforceSSL" yaml:"enforceSSL"`
	// IAM policy document to apply to topic(s).
	// Default: empty policy document.
	//
	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"))
policyDocument := iam.NewPolicyDocument(&PolicyDocumentProps{
	AssignSids: jsii.Boolean(true),
	Statements: []policyStatement{
		iam.NewPolicyStatement(&PolicyStatementProps{
			Actions: []*string{
				jsii.String("sns:Subscribe"),
			},
			Principals: []iPrincipal{
				iam.NewAnyPrincipal(),
			},
			Resources: []*string{
				topic.TopicArn,
			},
		}),
	},
})

topicPolicy := sns.NewTopicPolicy(this, jsii.String("Policy"), &TopicPolicyProps{
	Topics: []iTopic{
		topic,
	},
	PolicyDocument: PolicyDocument,
})

type TopicProps

type TopicProps struct {
	// Enables content-based deduplication for FIFO topics.
	// Default: None.
	//
	ContentBasedDeduplication *bool `field:"optional" json:"contentBasedDeduplication" yaml:"contentBasedDeduplication"`
	// A developer-defined string that can be used to identify this SNS topic.
	// Default: None.
	//
	DisplayName *string `field:"optional" json:"displayName" yaml:"displayName"`
	// Adds a statement to enforce encryption of data in transit when publishing to the topic.
	// See: https://docs.aws.amazon.com/sns/latest/dg/sns-security-best-practices.html#enforce-encryption-data-in-transit.
	//
	// Default: false.
	//
	EnforceSSL *bool `field:"optional" json:"enforceSSL" yaml:"enforceSSL"`
	// Set to true to create a FIFO topic.
	// Default: None.
	//
	Fifo *bool `field:"optional" json:"fifo" yaml:"fifo"`
	// The list of delivery status logging configurations for the topic.
	// See: https://docs.aws.amazon.com/sns/latest/dg/sns-topic-attributes.html.
	//
	// Default: None.
	//
	LoggingConfigs *[]*LoggingConfig `field:"optional" json:"loggingConfigs" yaml:"loggingConfigs"`
	// A KMS Key, either managed by this CDK app, or imported.
	// Default: None.
	//
	MasterKey awskms.IKey `field:"optional" json:"masterKey" yaml:"masterKey"`
	// The number of days Amazon SNS retains messages.
	//
	// It can only be set for FIFO topics.
	// See: https://docs.aws.amazon.com/sns/latest/dg/fifo-message-archiving-replay.html
	//
	// Default: - do not archive messages.
	//
	MessageRetentionPeriodInDays *float64 `field:"optional" json:"messageRetentionPeriodInDays" yaml:"messageRetentionPeriodInDays"`
	// 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.
	// See: https://docs.aws.amazon.com/sns/latest/dg/sns-verify-signature-of-message.html.
	//
	// Default: 1.
	//
	SignatureVersion *string `field:"optional" json:"signatureVersion" yaml:"signatureVersion"`
	// 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.
	// Default: Generated name.
	//
	TopicName *string `field:"optional" json:"topicName" yaml:"topicName"`
	// Tracing mode of an Amazon SNS topic.
	// See: https://docs.aws.amazon.com/sns/latest/dg/sns-active-tracing.html
	//
	// Default: TracingConfig.PASS_THROUGH
	//
	TracingConfig TracingConfig `field:"optional" json:"tracingConfig" yaml:"tracingConfig"`
}

Properties for a new SNS topic.

Example:

topic := sns.NewTopic(this, jsii.String("MyTopic"), &TopicProps{
	TracingConfig: sns.TracingConfig_ACTIVE,
})

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.
	// Default: - No dead letter queue enabled.
	//
	DeadLetterQueue awssqs.IQueue `field:"optional" json:"deadLetterQueue" yaml:"deadLetterQueue"`
	// The filter policy.
	// Default: - all messages are delivered.
	//
	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.
	// Default: - all messages are delivered.
	//
	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.
	// Default: false.
	//
	RawMessageDelivery *bool `field:"optional" json:"rawMessageDelivery" yaml:"rawMessageDelivery"`
	// The region where the topic resides, in the case of cross-region subscriptions.
	// Default: - the region where the CloudFormation stack is being deployed.
	//
	Region *string `field:"optional" json:"region" yaml:"region"`
	// Arn of role allowing access to firehose delivery stream.
	//
	// Required for a firehose subscription protocol.
	// Default: - No subscription role is provided.
	//
	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.
	// Default: - use the topic as the scope of the subscription, in which case `subscriberId` must be defined.
	//
	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.
	// Default: - empty list.
	//
	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"),
}

type TracingConfig added in v2.138.0

type TracingConfig string

The tracing mode of an Amazon SNS topic.

Example:

topic := sns.NewTopic(this, jsii.String("MyTopic"), &TopicProps{
	TracingConfig: sns.TracingConfig_ACTIVE,
})
const (
	// The mode that topic passes trace headers received from the Amazon SNS publisher to its subscription.
	TracingConfig_PASS_THROUGH TracingConfig = "PASS_THROUGH"
	// The mode that Amazon SNS vend X-Ray segment data to topic owner account if the sampled flag in the tracing header is true.
	TracingConfig_ACTIVE TracingConfig = "ACTIVE"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL