Skip to main content

CDK Constructs for deploying AWS Events Rule that invokes AWS SNS

Project description

aws-events-rule-sns module

---

Stability: Experimental

All classes are under active development and subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.


Reference Documentation: https://docs.aws.amazon.com/solutions/latest/constructs/
Language Package
Python Logo Python aws_solutions_constructs.aws_events_rule_sns
Typescript Logo Typescript @aws-solutions-constructs/aws-events-rule-sns
Java Logo Java software.amazon.awsconstructs.services.eventsrulesns

This AWS Solutions Construct implements an AWS Events rule and an AWS SNS Topic.

Here is a minimal deployable pattern definition in Typescript:

# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
from aws_cdk.core import Duration
import aws_cdk.aws_events as events
import aws_cdk.aws_iam as iam
from aws_solutions_constructs.aws_events_rule_sns import EventsRuleToSnsProps, EventsRuleToSns

props = EventsRuleToSnsProps(
    event_rule_props=RuleProps(
        schedule=events.Schedule.rate(Duration.minutes(5))
    )
)

construct_stack = EventsRuleToSns(self, "test-construct", props)

# Grant yourself permissions to use the Customer Managed KMS Key
policy_statement = iam.PolicyStatement(
    actions=["kms:Encrypt", "kms:Decrypt"],
    effect=iam.Effect.ALLOW,
    principals=[iam.AccountRootPrincipal()],
    resources=["*"]
)

construct_stack.encryption_key.add_to_resource_policy(policy_statement)

Initializer

new EventsRuleToSns(scope: Construct, id: string, props: EventsRuleToSnsProps);

Parameters

Pattern Construct Props

Name Type Description
eventRuleProps events.RuleProps User provided eventRuleProps to override the defaults.
existingTopicObj? sns.Topic Existing instance of SNS Topic object, if this is set then the topicProps is ignored.
topicProps? sns.TopicProps User provided props to override the default props for the SNS Topic.
enableEncryptionWithCustomerManagedKey? boolean Use a KMS Key, either managed by this CDK app, or imported. If importing an encryption key, it must be specified in the encryptionKey property for this construct.
encryptionKey? kms.Key An optional, imported encryption key to encrypt the SNS Topic.
encryptionKeyProps? kms.KeyProps An optional, user provided properties to override the default properties for the KMS encryption key.

Pattern Properties

Name Type Description
eventsRule events.Rule Returns an instance of events.Rule created by the construct
snsTopic sns.Topic Returns an instance of sns.Topic created by the construct
encryptionKey? kms.Key Returns an instance of kms Key used for the SNS Topic.

Default settings

Out of the box implementation of the Construct without any override will set the following defaults:

Amazon CloudWatch Events Rule

  • Grant least privilege permissions to CloudWatch Events to publish to the SNS Topic.

Amazon SNS Topic

  • Configure least privilege access permissions for SNS Topic.
  • Enable server-side encryption forSNS Topic using Customer managed KMS Key.
  • Enforce encryption of data in transit.

Architecture

Architecture Diagram


© Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file aws-solutions-constructs.aws-events-rule-sns-1.99.0.tar.gz.

File metadata

  • Download URL: aws-solutions-constructs.aws-events-rule-sns-1.99.0.tar.gz
  • Upload date:
  • Size: 228.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.5

File hashes

Hashes for aws-solutions-constructs.aws-events-rule-sns-1.99.0.tar.gz
Algorithm Hash digest
SHA256 41176070af32bae5396b9a6979a58b746eb80dfa6053af19680a488675dbd7c6
MD5 acc77ad60ae54d7236bd110f1a71ee4a
BLAKE2b-256 b5be78e7f72fa7fe866287ad583009a74eb451acce22760a2ad461044f909c16

See more details on using hashes here.

File details

Details for the file aws_solutions_constructs.aws_events_rule_sns-1.99.0-py3-none-any.whl.

File metadata

File hashes

Hashes for aws_solutions_constructs.aws_events_rule_sns-1.99.0-py3-none-any.whl
Algorithm Hash digest
SHA256 516b20e432b123661d9c99a1ffa0271fb9966c0ac07ac7c34956dfaa934f5980
MD5 93da0011a3164829827e9f173a5dbdd9
BLAKE2b-256 822a30d7e97570345359d76ff5512b65cd06932e6edbee13a80805565cb19c25

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page