awsevents

package
v2.58.1 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: Apache-2.0 Imports: 8 Imported by: 44

README

Amazon EventBridge Construct Library

Amazon EventBridge delivers a near real-time stream of system events that describe changes in AWS resources. For example, an AWS CodePipeline emits the State Change event when the pipeline changes its state.

  • Events: An event indicates a change in your AWS environment. AWS resources can generate events when their state changes. For example, Amazon EC2 generates an event when the state of an EC2 instance changes from pending to running, and Amazon EC2 Auto Scaling generates events when it launches or terminates instances. AWS CloudTrail publishes events when you make API calls. You can generate custom application-level events and publish them to EventBridge. You can also set up scheduled events that are generated on a periodic basis. For a list of services that generate events, and sample events from each service, see EventBridge Event Examples From Each Supported Service.
  • Targets: A target processes events. Targets can include Amazon EC2 instances, AWS Lambda functions, Kinesis streams, Amazon ECS tasks, Step Functions state machines, Amazon SNS topics, Amazon SQS queues, Amazon CloudWatch LogGroups, and built-in targets. A target receives events in JSON format.
  • Rules: A rule matches incoming events and routes them to targets for processing. A single rule can route to multiple targets, all of which are processed in parallel. Rules are not processed in a particular order. This enables different parts of an organization to look for and process the events that are of interest to them. A rule can customize the JSON sent to the target, by passing only certain parts or by overwriting it with a constant.
  • EventBuses: An event bus can receive events from your own custom applications or it can receive events from applications and services created by AWS SaaS partners. See Creating an Event Bus.

Rule

The Rule construct defines an EventBridge rule which monitors an event based on an event pattern and invoke event targets when the pattern is matched against a triggered event. Event targets are objects that implement the IRuleTarget interface.

Normally, you will use one of the source.onXxx(name[, target[, options]]) -> Rule methods on the event source to define an event rule associated with the specific activity. You can targets either via props, or add targets using rule.addTarget.

For example, to define an rule that triggers a CodeBuild project build when a commit is pushed to the "master" branch of a CodeCommit repository:

var repo repository
var project project


onCommitRule := repo.onCommit(jsii.String("OnCommit"), &onCommitOptions{
	target: targets.NewCodeBuildProject(project),
	branches: []*string{
		jsii.String("master"),
	},
})

You can add additional targets, with optional input transformer using eventRule.addTarget(target[, input]). For example, we can add a SNS topic target which formats a human-readable message for the commit.

For example, this adds an SNS topic as a target:

var onCommitRule rule
var topic topic


onCommitRule.addTarget(targets.NewSnsTopic(topic, &snsTopicProps{
	message: events.ruleTargetInput.fromText(
	fmt.Sprintf("A commit was pushed to the repository %v on branch %v", codecommit.referenceEvent.repositoryName, codecommit.*referenceEvent.referenceName)),
}))

Or using an Object:

var onCommitRule rule
var topic topic


onCommitRule.addTarget(targets.NewSnsTopic(topic, &snsTopicProps{
	message: events.ruleTargetInput.fromObject(map[string]*string{
		"DataType": fmt.Sprintf("custom_%v", events.EventField.fromPath(jsii.String("$.detail-type"))),
	}),
}))

To define a pattern, use the matcher API, which provides a number of factory methods to declare different logical predicates. For example, to match all S3 events for objects larger than 1024 bytes, stored using one of the storage classes Glacier, Glacier IR or Deep Archive and coming from any region other than the AWS GovCloud ones:

// Example automatically generated from non-compiling source. May contain errors.
rule := events.NewRule(this, jsii.String("rule"), &ruleProps{
	eventPattern: &eventPattern{
		detail: map[string]interface{}{
			"object": map[string][]*string{
				// Matchers may appear at any level
				"size": events.Match.greaterThan(jsii.Number(1024)),
			},

			// 'OR' condition
			"source-storage-class": events.Match.anyOf(events.Match.prefix(jsii.String("GLACIER")), events.Match.exactString(jsii.String("DEEP_ARCHIVE"))),
		},
		detailtype: events.match.equalsIgnoreCase(jsii.String("object created")),

		// If you prefer, you can use a low level array of strings, as directly consumed by EventBridge
		source: []*string{
			jsii.String("aws.s3"),
		},

		region: events.*match.anythingButPrefix(jsii.String("us-gov")),
	},
})

Scheduling

You can configure a Rule to run on a schedule (cron or rate). Rate must be specified in minutes, hours or days.

The following example runs a task every day at 4am:

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

var cluster cluster
var taskDefinition taskDefinition
var role role


ecsTaskTarget := awscdk.NewEcsTask(&ecsTaskProps{
	cluster: cluster,
	taskDefinition: taskDefinition,
	role: role,
})

awscdk.NewRule(this, jsii.String("ScheduleRule"), &ruleProps{
	schedule: awscdk.Schedule.cron(&cronOptions{
		minute: jsii.String("0"),
		hour: jsii.String("4"),
	}),
	targets: []iRuleTarget{
		ecsTaskTarget,
	},
})

If you want to specify Fargate platform version, set platformVersion in EcsTask's props like the following example:

var cluster cluster
var taskDefinition taskDefinition
var role role


platformVersion := ecs.fargatePlatformVersion_VERSION1_4
ecsTaskTarget := targets.NewEcsTask(&ecsTaskProps{
	cluster: cluster,
	taskDefinition: taskDefinition,
	role: role,
	platformVersion: platformVersion,
})

Event Targets

The @aws-cdk/aws-events-targets module includes classes that implement the IRuleTarget interface for various AWS services.

The following targets are supported:

  • targets.CodeBuildProject: Start an AWS CodeBuild build
  • targets.CodePipeline: Start an AWS CodePipeline pipeline execution
  • targets.EcsTask: Start a task on an Amazon ECS cluster
  • targets.LambdaFunction: Invoke an AWS Lambda function
  • targets.SnsTopic: Publish into an SNS topic
  • targets.SqsQueue: Send a message to an Amazon SQS Queue
  • targets.SfnStateMachine: Trigger an AWS Step Functions state machine
  • targets.BatchJob: Queue an AWS Batch Job
  • targets.AwsApi: Make an AWS API call
  • targets.ApiGateway: Invoke an AWS API Gateway
  • targets.ApiDestination: Make an call to an external destination
Cross-account and cross-region targets

It's possible to have the source of the event and a target in separate AWS accounts and regions:

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

app := awscdk.NewApp()

account1 := "11111111111"
account2 := "22222222222"

stack1 := awscdk.NewStack(app, jsii.String("Stack1"), &stackProps{
	env: &environment{
		account: account1,
		region: jsii.String("us-west-1"),
	},
})
repo := codecommit.NewRepository(stack1, jsii.String("Repository"), &repositoryProps{
	repositoryName: jsii.String("myrepository"),
})

stack2 := awscdk.NewStack(app, jsii.String("Stack2"), &stackProps{
	env: &environment{
		account: account2,
		region: jsii.String("us-east-1"),
	},
})
project := codebuild.NewProject(stack2, jsii.String("Project"), &projectProps{
})

repo.onCommit(jsii.String("OnCommit"), &onCommitOptions{
	target: targets.NewCodeBuildProject(project),
})

In this situation, the CDK will wire the 2 accounts together:

  • It will generate a rule in the source stack with the event bus of the target account as the target
  • It will generate a rule in the target stack, with the provided target
  • It will generate a separate stack that gives the source account permissions to publish events to the event bus of the target account in the given region, and make sure its deployed before the source stack

For more information, see the AWS documentation on cross-account events.

Archiving

It is possible to archive all or some events sent to an event bus. It is then possible to replay these events.

bus := events.NewEventBus(this, jsii.String("bus"), &eventBusProps{
	eventBusName: jsii.String("MyCustomEventBus"),
})

bus.archive(jsii.String("MyArchive"), &baseArchiveProps{
	archiveName: jsii.String("MyCustomEventBusArchive"),
	description: jsii.String("MyCustomerEventBus Archive"),
	eventPattern: &eventPattern{
		account: []*string{
			awscdk.*stack.of(this).account,
		},
	},
	retention: awscdk.Duration.days(jsii.Number(365)),
})

Granting PutEvents to an existing EventBus

To import an existing EventBus into your CDK application, use EventBus.fromEventBusArn, EventBus.fromEventBusAttributes or EventBus.fromEventBusName factory method.

Then, you can use the grantPutEventsTo method to grant event:PutEvents to the eventBus.

var lambdaFunction function


eventBus := events.eventBus.fromEventBusArn(this, jsii.String("ImportedEventBus"), jsii.String("arn:aws:events:us-east-1:111111111:event-bus/my-event-bus"))

// now you can just call methods on the eventbus
eventBus.grantPutEventsTo(lambdaFunction)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApiDestination_IsConstruct added in v2.13.0

func ApiDestination_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 ApiDestination_IsOwnedResource added in v2.32.0

func ApiDestination_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise.

func ApiDestination_IsResource added in v2.13.0

func ApiDestination_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

func Archive_IsConstruct

func Archive_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 Archive_IsOwnedResource added in v2.32.0

func Archive_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise.

func Archive_IsResource

func Archive_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

func CfnApiDestination_CFN_RESOURCE_TYPE_NAME

func CfnApiDestination_CFN_RESOURCE_TYPE_NAME() *string

func CfnApiDestination_IsCfnElement

func CfnApiDestination_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 CfnApiDestination_IsCfnResource

func CfnApiDestination_IsCfnResource(construct constructs.IConstruct) *bool

Check whether the given construct is a CfnResource.

func CfnApiDestination_IsConstruct

func CfnApiDestination_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 CfnArchive_CFN_RESOURCE_TYPE_NAME

func CfnArchive_CFN_RESOURCE_TYPE_NAME() *string

func CfnArchive_IsCfnElement

func CfnArchive_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 CfnArchive_IsCfnResource

func CfnArchive_IsCfnResource(construct constructs.IConstruct) *bool

Check whether the given construct is a CfnResource.

func CfnArchive_IsConstruct

func CfnArchive_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 CfnConnection_CFN_RESOURCE_TYPE_NAME

func CfnConnection_CFN_RESOURCE_TYPE_NAME() *string

func CfnConnection_IsCfnElement

func CfnConnection_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 CfnConnection_IsCfnResource

func CfnConnection_IsCfnResource(construct constructs.IConstruct) *bool

Check whether the given construct is a CfnResource.

func CfnConnection_IsConstruct

func CfnConnection_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 CfnEndpoint_CFN_RESOURCE_TYPE_NAME added in v2.21.0

func CfnEndpoint_CFN_RESOURCE_TYPE_NAME() *string

func CfnEndpoint_IsCfnElement added in v2.21.0

func CfnEndpoint_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 CfnEndpoint_IsCfnResource added in v2.21.0

func CfnEndpoint_IsCfnResource(construct constructs.IConstruct) *bool

Check whether the given construct is a CfnResource.

func CfnEndpoint_IsConstruct added in v2.21.0

func CfnEndpoint_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 CfnEventBusPolicy_CFN_RESOURCE_TYPE_NAME

func CfnEventBusPolicy_CFN_RESOURCE_TYPE_NAME() *string

func CfnEventBusPolicy_IsCfnElement

func CfnEventBusPolicy_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 CfnEventBusPolicy_IsCfnResource

func CfnEventBusPolicy_IsCfnResource(construct constructs.IConstruct) *bool

Check whether the given construct is a CfnResource.

func CfnEventBusPolicy_IsConstruct

func CfnEventBusPolicy_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 CfnEventBus_CFN_RESOURCE_TYPE_NAME

func CfnEventBus_CFN_RESOURCE_TYPE_NAME() *string

func CfnEventBus_IsCfnElement

func CfnEventBus_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 CfnEventBus_IsCfnResource

func CfnEventBus_IsCfnResource(construct constructs.IConstruct) *bool

Check whether the given construct is a CfnResource.

func CfnEventBus_IsConstruct

func CfnEventBus_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 CfnRule_CFN_RESOURCE_TYPE_NAME

func CfnRule_CFN_RESOURCE_TYPE_NAME() *string

func CfnRule_IsCfnElement

func CfnRule_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 CfnRule_IsCfnResource

func CfnRule_IsCfnResource(construct constructs.IConstruct) *bool

Check whether the given construct is a CfnResource.

func CfnRule_IsConstruct

func CfnRule_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 Connection_IsConstruct added in v2.13.0

func Connection_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 Connection_IsOwnedResource added in v2.32.0

func Connection_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise.

func Connection_IsResource added in v2.13.0

func Connection_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

func EventBusPolicy_IsConstruct added in v2.54.0

func EventBusPolicy_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 EventBusPolicy_IsOwnedResource added in v2.54.0

func EventBusPolicy_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise.

func EventBusPolicy_IsResource added in v2.54.0

func EventBusPolicy_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

func EventBus_GrantAllPutEvents

func EventBus_GrantAllPutEvents(grantee awsiam.IGrantable) awsiam.Grant

Permits an IAM Principal to send custom events to EventBridge so that they can be matched to rules.

func EventBus_IsConstruct

func EventBus_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 EventBus_IsOwnedResource added in v2.32.0

func EventBus_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise.

func EventBus_IsResource

func EventBus_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

func EventField_Account

func EventField_Account() *string

func EventField_DetailType

func EventField_DetailType() *string

func EventField_EventId

func EventField_EventId() *string

func EventField_FromPath

func EventField_FromPath(path *string) *string

Extract a custom JSON path from the event.

func EventField_Region

func EventField_Region() *string

func EventField_Source

func EventField_Source() *string

func EventField_Time

func EventField_Time() *string

func Match_AllOf added in v2.37.0

func Match_AllOf(matchers ...interface{}) *[]*string

Matches an event if any of the provided matchers do.

Only numeric matchers are accepted.

func Match_AnyOf added in v2.37.0

func Match_AnyOf(matchers ...interface{}) *[]*string

Matches an event if any of the provided matchers does.

func Match_AnythingBut added in v2.37.0

func Match_AnythingBut(values ...interface{}) *[]*string

Matches anything except what's provided in the rule.

The list of provided values must contain only strings or only numbers.

func Match_AnythingButPrefix added in v2.37.0

func Match_AnythingButPrefix(prefix *string) *[]*string

Matches any string that doesn't start with the given prefix.

func Match_Cidr added in v2.37.0

func Match_Cidr(range_ *string) *[]*string

Matches IPv4 and IPv6 network addresses using the Classless Inter-Domain Routing (CIDR) format.

func Match_DoesNotExist added in v2.37.0

func Match_DoesNotExist() *[]*string

Matches when the field is present in the JSON of the event.

func Match_Equal added in v2.37.0

func Match_Equal(value *float64) *[]*string

Matches numbers equal to the provided value.

func Match_EqualsIgnoreCase added in v2.54.0

func Match_EqualsIgnoreCase(value *string) *[]*string

Matches a string, regardless of case, in the JSON of the event.

func Match_ExactString added in v2.37.0

func Match_ExactString(value *string) *[]*string

Matches a string, exactly, in the JSON of the event.

func Match_Exists added in v2.37.0

func Match_Exists() *[]*string

Matches when the field is absent from the JSON of the event.

func Match_GreaterThan added in v2.37.0

func Match_GreaterThan(value *float64) *[]*string

Matches numbers greater than the provided value.

func Match_GreaterThanOrEqual added in v2.37.0

func Match_GreaterThanOrEqual(value *float64) *[]*string

Matches numbers greater than, or equal to, the provided value.

func Match_Interval added in v2.37.0

func Match_Interval(lower *float64, upper *float64) *[]*string

Matches numbers inside a closed numeric interval. Equivalent to:.

Match.allOf(Match.greaterThanOrEqual(lower), Match.lessThanOrEqual(upper))

func Match_IpAddressRange added in v2.37.0

func Match_IpAddressRange(range_ *string) *[]*string

Matches IPv4 and IPv6 network addresses using the Classless Inter-Domain Routing (CIDR) format.

Alias of `cidr()`.

func Match_LessThan added in v2.37.0

func Match_LessThan(value *float64) *[]*string

Matches numbers less than the provided value.

func Match_LessThanOrEqual added in v2.37.0

func Match_LessThanOrEqual(value *float64) *[]*string

Matches numbers less than, or equal to, the provided value.

func Match_NullValue added in v2.37.0

func Match_NullValue() *[]*string

Matches a null value in the JSON of the event.

func Match_Prefix added in v2.37.0

func Match_Prefix(value *string) *[]*string

Matches strings with the given prefix in the JSON of the event.

func Match_Suffix added in v2.54.0

func Match_Suffix(value *string) *[]*string

Matches strings with the given suffix in the JSON of the event.

func NewApiDestination_Override added in v2.13.0

func NewApiDestination_Override(a ApiDestination, scope constructs.Construct, id *string, props *ApiDestinationProps)

func NewArchive_Override

func NewArchive_Override(a Archive, scope constructs.Construct, id *string, props *ArchiveProps)

func NewAuthorization_Override added in v2.13.0

func NewAuthorization_Override(a Authorization)

func NewCfnApiDestination_Override

func NewCfnApiDestination_Override(c CfnApiDestination, scope constructs.Construct, id *string, props *CfnApiDestinationProps)

Create a new `AWS::Events::ApiDestination`.

func NewCfnArchive_Override

func NewCfnArchive_Override(c CfnArchive, scope constructs.Construct, id *string, props *CfnArchiveProps)

Create a new `AWS::Events::Archive`.

func NewCfnConnection_Override

func NewCfnConnection_Override(c CfnConnection, scope constructs.Construct, id *string, props *CfnConnectionProps)

Create a new `AWS::Events::Connection`.

func NewCfnEndpoint_Override added in v2.21.0

func NewCfnEndpoint_Override(c CfnEndpoint, scope constructs.Construct, id *string, props *CfnEndpointProps)

Create a new `AWS::Events::Endpoint`.

func NewCfnEventBusPolicy_Override

func NewCfnEventBusPolicy_Override(c CfnEventBusPolicy, scope constructs.Construct, id *string, props *CfnEventBusPolicyProps)

Create a new `AWS::Events::EventBusPolicy`.

func NewCfnEventBus_Override

func NewCfnEventBus_Override(c CfnEventBus, scope constructs.Construct, id *string, props *CfnEventBusProps)

Create a new `AWS::Events::EventBus`.

func NewCfnRule_Override

func NewCfnRule_Override(c CfnRule, scope constructs.Construct, id *string, props *CfnRuleProps)

Create a new `AWS::Events::Rule`.

func NewConnection_Override added in v2.13.0

func NewConnection_Override(c Connection, scope constructs.Construct, id *string, props *ConnectionProps)

func NewEventBusPolicy_Override added in v2.54.0

func NewEventBusPolicy_Override(e EventBusPolicy, scope constructs.Construct, id *string, props *EventBusPolicyProps)

func NewEventBus_Override

func NewEventBus_Override(e EventBus, scope constructs.Construct, id *string, props *EventBusProps)

func NewHttpParameter_Override added in v2.13.0

func NewHttpParameter_Override(h HttpParameter)

func NewRuleTargetInput_Override

func NewRuleTargetInput_Override(r RuleTargetInput)

func NewRule_Override

func NewRule_Override(r Rule, scope constructs.Construct, id *string, props *RuleProps)

func NewSchedule_Override

func NewSchedule_Override(s Schedule)

func Rule_IsConstruct

func Rule_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 Rule_IsOwnedResource added in v2.32.0

func Rule_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise.

func Rule_IsResource

func Rule_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

Types

type ApiDestination added in v2.13.0

type ApiDestination interface {
	awscdk.Resource
	IApiDestination
	// The ARN of the Api Destination created.
	ApiDestinationArn() *string
	// The Name of the Api Destination created.
	ApiDestinationName() *string
	// The Connection to associate with Api Destination.
	Connection() IConnection
	// 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
}

Define an EventBridge Api Destination.

Example:

connection := events.NewConnection(this, jsii.String("Connection"), &connectionProps{
	authorization: events.authorization.apiKey(jsii.String("x-api-key"), awscdk.SecretValue.secretsManager(jsii.String("ApiSecretName"))),
	description: jsii.String("Connection with API Key x-api-key"),
})

destination := events.NewApiDestination(this, jsii.String("Destination"), &apiDestinationProps{
	connection: connection,
	endpoint: jsii.String("https://example.com"),
	description: jsii.String("Calling example.com with API key x-api-key"),
})

rule := events.NewRule(this, jsii.String("Rule"), &ruleProps{
	schedule: events.schedule.rate(cdk.duration.minutes(jsii.Number(1))),
	targets: []iRuleTarget{
		targets.NewApiDestination(destination),
	},
})

func NewApiDestination added in v2.13.0

func NewApiDestination(scope constructs.Construct, id *string, props *ApiDestinationProps) ApiDestination

type ApiDestinationProps added in v2.13.0

type ApiDestinationProps struct {
	// The ARN of the connection to use for the API destination.
	Connection IConnection `field:"required" json:"connection" yaml:"connection"`
	// The URL to the HTTP invocation endpoint for the API destination..
	Endpoint *string `field:"required" json:"endpoint" yaml:"endpoint"`
	// The name for the API destination.
	ApiDestinationName *string `field:"optional" json:"apiDestinationName" yaml:"apiDestinationName"`
	// A description for the API destination.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The method to use for the request to the HTTP invocation endpoint.
	HttpMethod HttpMethod `field:"optional" json:"httpMethod" yaml:"httpMethod"`
	// The maximum number of requests per second to send to the HTTP invocation endpoint.
	RateLimitPerSecond *float64 `field:"optional" json:"rateLimitPerSecond" yaml:"rateLimitPerSecond"`
}

The event API Destination properties.

Example:

connection := events.NewConnection(this, jsii.String("Connection"), &connectionProps{
	authorization: events.authorization.apiKey(jsii.String("x-api-key"), awscdk.SecretValue.secretsManager(jsii.String("ApiSecretName"))),
	description: jsii.String("Connection with API Key x-api-key"),
})

destination := events.NewApiDestination(this, jsii.String("Destination"), &apiDestinationProps{
	connection: connection,
	endpoint: jsii.String("https://example.com"),
	description: jsii.String("Calling example.com with API key x-api-key"),
})

rule := events.NewRule(this, jsii.String("Rule"), &ruleProps{
	schedule: events.schedule.rate(cdk.duration.minutes(jsii.Number(1))),
	targets: []iRuleTarget{
		targets.NewApiDestination(destination),
	},
})

type Archive

type Archive interface {
	awscdk.Resource
	// The ARN of the archive created.
	ArchiveArn() *string
	// The archive name.
	ArchiveName() *string
	// 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
}

Define an EventBridge Archive.

Example:

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

var detail interface{}
var eventBus eventBus

archive := awscdk.Aws_events.NewArchive(this, jsii.String("MyArchive"), &archiveProps{
	eventPattern: &eventPattern{
		account: []*string{
			jsii.String("account"),
		},
		detail: map[string]interface{}{
			"detailKey": detail,
		},
		detailType: []*string{
			jsii.String("detailType"),
		},
		id: []*string{
			jsii.String("id"),
		},
		region: []*string{
			jsii.String("region"),
		},
		resources: []*string{
			jsii.String("resources"),
		},
		source: []*string{
			jsii.String("source"),
		},
		time: []*string{
			jsii.String("time"),
		},
		version: []*string{
			jsii.String("version"),
		},
	},
	sourceEventBus: eventBus,

	// the properties below are optional
	archiveName: jsii.String("archiveName"),
	description: jsii.String("description"),
	retention: cdk.duration.minutes(jsii.Number(30)),
})

func NewArchive

func NewArchive(scope constructs.Construct, id *string, props *ArchiveProps) Archive

type ArchiveProps

type ArchiveProps struct {
	// An event pattern to use to filter events sent to the archive.
	EventPattern *EventPattern `field:"required" json:"eventPattern" yaml:"eventPattern"`
	// The name of the archive.
	ArchiveName *string `field:"optional" json:"archiveName" yaml:"archiveName"`
	// A description for the archive.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The number of days to retain events for.
	//
	// Default value is 0. If set to 0, events are retained indefinitely.
	Retention awscdk.Duration `field:"optional" json:"retention" yaml:"retention"`
	// The event source associated with the archive.
	SourceEventBus IEventBus `field:"required" json:"sourceEventBus" yaml:"sourceEventBus"`
}

The event archive properties.

Example:

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

var detail interface{}
var eventBus eventBus

archiveProps := &archiveProps{
	eventPattern: &eventPattern{
		account: []*string{
			jsii.String("account"),
		},
		detail: map[string]interface{}{
			"detailKey": detail,
		},
		detailType: []*string{
			jsii.String("detailType"),
		},
		id: []*string{
			jsii.String("id"),
		},
		region: []*string{
			jsii.String("region"),
		},
		resources: []*string{
			jsii.String("resources"),
		},
		source: []*string{
			jsii.String("source"),
		},
		time: []*string{
			jsii.String("time"),
		},
		version: []*string{
			jsii.String("version"),
		},
	},
	sourceEventBus: eventBus,

	// the properties below are optional
	archiveName: jsii.String("archiveName"),
	description: jsii.String("description"),
	retention: cdk.duration.minutes(jsii.Number(30)),
}

type Authorization added in v2.13.0

type Authorization interface {
}

Authorization type for an API Destination Connection.

Example:

connection := events.NewConnection(this, jsii.String("Connection"), &connectionProps{
	authorization: events.authorization.apiKey(jsii.String("x-api-key"), awscdk.SecretValue.secretsManager(jsii.String("ApiSecretName"))),
	description: jsii.String("Connection with API Key x-api-key"),
})

destination := events.NewApiDestination(this, jsii.String("Destination"), &apiDestinationProps{
	connection: connection,
	endpoint: jsii.String("https://example.com"),
	description: jsii.String("Calling example.com with API key x-api-key"),
})

rule := events.NewRule(this, jsii.String("Rule"), &ruleProps{
	schedule: events.schedule.rate(cdk.duration.minutes(jsii.Number(1))),
	targets: []iRuleTarget{
		targets.NewApiDestination(destination),
	},
})

func Authorization_ApiKey added in v2.13.0

func Authorization_ApiKey(apiKeyName *string, apiKeyValue awscdk.SecretValue) Authorization

Use API key authorization.

API key authorization has two components: an API key name and an API key value. What these are depends on the target of your connection.

func Authorization_Basic added in v2.13.0

func Authorization_Basic(username *string, password awscdk.SecretValue) Authorization

Use username and password authorization.

func Authorization_Oauth added in v2.13.0

func Authorization_Oauth(props *OAuthAuthorizationProps) Authorization

Use OAuth authorization.

type BaseArchiveProps

type BaseArchiveProps struct {
	// An event pattern to use to filter events sent to the archive.
	EventPattern *EventPattern `field:"required" json:"eventPattern" yaml:"eventPattern"`
	// The name of the archive.
	ArchiveName *string `field:"optional" json:"archiveName" yaml:"archiveName"`
	// A description for the archive.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The number of days to retain events for.
	//
	// Default value is 0. If set to 0, events are retained indefinitely.
	Retention awscdk.Duration `field:"optional" json:"retention" yaml:"retention"`
}

The event archive base properties.

Example:

bus := events.NewEventBus(this, jsii.String("bus"), &eventBusProps{
	eventBusName: jsii.String("MyCustomEventBus"),
})

bus.archive(jsii.String("MyArchive"), &baseArchiveProps{
	archiveName: jsii.String("MyCustomEventBusArchive"),
	description: jsii.String("MyCustomerEventBus Archive"),
	eventPattern: &eventPattern{
		account: []*string{
			awscdk.*stack.of(this).account,
		},
	},
	retention: awscdk.Duration.days(jsii.Number(365)),
})

type CfnApiDestination

type CfnApiDestination interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// The ARN of the API destination that was created by the request.
	AttrArn() *string
	// Options for this resource, such as condition, update policy etc.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	CfnResourceType() *string
	// The ARN of the connection to use for the API destination.
	//
	// The destination endpoint must support the authorization type specified for the connection.
	ConnectionArn() *string
	SetConnectionArn(val *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
	// A description for the API destination to create.
	Description() *string
	SetDescription(val *string)
	// The method to use for the request to the HTTP invocation endpoint.
	HttpMethod() *string
	SetHttpMethod(val *string)
	// The URL to the HTTP invocation endpoint for the API destination.
	InvocationEndpoint() *string
	SetInvocationEndpoint(val *string)
	// The maximum number of requests per second to send to the HTTP invocation endpoint.
	InvocationRateLimitPerSecond() *float64
	SetInvocationRateLimitPerSecond(val *float64)
	// 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 name for the API destination to create.
	Name() *string
	SetName(val *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 stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	Stack() awscdk.Stack
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//    "GlobalSecondaryIndexes": [
	//      {
	//        "Projection": {
	//          "NonKeyAttributes": [ "myattribute" ]
	//          ...
	//        }
	//        ...
	//      },
	//      {
	//        "ProjectionType": "INCLUDE"
	//        ...
	//      },
	//    ]
	//    ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

A CloudFormation `AWS::Events::ApiDestination`.

Creates an API destination, which is an HTTP invocation endpoint configured as a target for events.

When using ApiDesinations with OAuth authentication we recommend these best practices:

- Create a secret in Secrets Manager with your OAuth credentials. - Reference that secret in your CloudFormation template for `AWS::Events::Connection` using CloudFormation dynamic reference syntax. For more information, see [Secrets Manager secrets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html#dynamic-references-secretsmanager) .

When the Connection resource is created the secret will be passed to EventBridge and stored in the customer account using “Service Linked Secrets,” effectively creating two secrets. This will minimize the cost because the original secret is only accessed when a CloudFormation template is created or updated, not every time an event is sent to the ApiDestination. The secret stored in the customer account by EventBridge is the one used for each event sent to the ApiDestination and AWS is responsible for the fees.

> The secret stored in the customer account by EventBridge can’t be updated directly, only when a CloudFormation template is updated.

For examples of CloudFormation templates that use secrets, see [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-connection.html#aws-resource-events-connection--examples) .

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"

cfnApiDestination := awscdk.Aws_events.NewCfnApiDestination(this, jsii.String("MyCfnApiDestination"), &cfnApiDestinationProps{
	connectionArn: jsii.String("connectionArn"),
	httpMethod: jsii.String("httpMethod"),
	invocationEndpoint: jsii.String("invocationEndpoint"),

	// the properties below are optional
	description: jsii.String("description"),
	invocationRateLimitPerSecond: jsii.Number(123),
	name: jsii.String("name"),
})

func NewCfnApiDestination

func NewCfnApiDestination(scope constructs.Construct, id *string, props *CfnApiDestinationProps) CfnApiDestination

Create a new `AWS::Events::ApiDestination`.

type CfnApiDestinationProps

type CfnApiDestinationProps struct {
	// The ARN of the connection to use for the API destination.
	//
	// The destination endpoint must support the authorization type specified for the connection.
	ConnectionArn *string `field:"required" json:"connectionArn" yaml:"connectionArn"`
	// The method to use for the request to the HTTP invocation endpoint.
	HttpMethod *string `field:"required" json:"httpMethod" yaml:"httpMethod"`
	// The URL to the HTTP invocation endpoint for the API destination.
	InvocationEndpoint *string `field:"required" json:"invocationEndpoint" yaml:"invocationEndpoint"`
	// A description for the API destination to create.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The maximum number of requests per second to send to the HTTP invocation endpoint.
	InvocationRateLimitPerSecond *float64 `field:"optional" json:"invocationRateLimitPerSecond" yaml:"invocationRateLimitPerSecond"`
	// The name for the API destination to create.
	Name *string `field:"optional" json:"name" yaml:"name"`
}

Properties for defining a `CfnApiDestination`.

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"

cfnApiDestinationProps := &cfnApiDestinationProps{
	connectionArn: jsii.String("connectionArn"),
	httpMethod: jsii.String("httpMethod"),
	invocationEndpoint: jsii.String("invocationEndpoint"),

	// the properties below are optional
	description: jsii.String("description"),
	invocationRateLimitPerSecond: jsii.Number(123),
	name: jsii.String("name"),
}

type CfnArchive

type CfnArchive interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// The name for the archive to create.
	ArchiveName() *string
	SetArchiveName(val *string)
	// The archive name.
	AttrArchiveName() *string
	// The ARN of the archive created.
	AttrArn() *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
	// A description for the archive.
	Description() *string
	SetDescription(val *string)
	// An event pattern to use to filter events sent to the archive.
	EventPattern() interface{}
	SetEventPattern(val interface{})
	// 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 number of days to retain events for.
	//
	// Default value is 0. If set to 0, events are retained indefinitely
	RetentionDays() *float64
	SetRetentionDays(val *float64)
	// The ARN of the event bus that sends events to the archive.
	SourceArn() *string
	SetSourceArn(val *string)
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	Stack() awscdk.Stack
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//    "GlobalSecondaryIndexes": [
	//      {
	//        "Projection": {
	//          "NonKeyAttributes": [ "myattribute" ]
	//          ...
	//        }
	//        ...
	//      },
	//      {
	//        "ProjectionType": "INCLUDE"
	//        ...
	//      },
	//    ]
	//    ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

A CloudFormation `AWS::Events::Archive`.

Creates an archive of events with the specified settings. When you create an archive, incoming events might not immediately start being sent to the archive. Allow a short period of time for changes to take effect. If you do not specify a pattern to filter events sent to the archive, all events are sent to the archive except replayed events. Replayed events are not sent to an archive.

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

cfnArchive := awscdk.Aws_events.NewCfnArchive(this, jsii.String("MyCfnArchive"), &cfnArchiveProps{
	sourceArn: jsii.String("sourceArn"),

	// the properties below are optional
	archiveName: jsii.String("archiveName"),
	description: jsii.String("description"),
	eventPattern: eventPattern,
	retentionDays: jsii.Number(123),
})

func NewCfnArchive

func NewCfnArchive(scope constructs.Construct, id *string, props *CfnArchiveProps) CfnArchive

Create a new `AWS::Events::Archive`.

type CfnArchiveProps

type CfnArchiveProps struct {
	// The ARN of the event bus that sends events to the archive.
	SourceArn *string `field:"required" json:"sourceArn" yaml:"sourceArn"`
	// The name for the archive to create.
	ArchiveName *string `field:"optional" json:"archiveName" yaml:"archiveName"`
	// A description for the archive.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// An event pattern to use to filter events sent to the archive.
	EventPattern interface{} `field:"optional" json:"eventPattern" yaml:"eventPattern"`
	// The number of days to retain events for.
	//
	// Default value is 0. If set to 0, events are retained indefinitely
	RetentionDays *float64 `field:"optional" json:"retentionDays" yaml:"retentionDays"`
}

Properties for defining a `CfnArchive`.

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

cfnArchiveProps := &cfnArchiveProps{
	sourceArn: jsii.String("sourceArn"),

	// the properties below are optional
	archiveName: jsii.String("archiveName"),
	description: jsii.String("description"),
	eventPattern: eventPattern,
	retentionDays: jsii.Number(123),
}

type CfnConnection

type CfnConnection interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// The ARN of the connection that was created by the request.
	AttrArn() *string
	// The ARN for the secret created for the connection.
	AttrSecretArn() *string
	// The type of authorization to use for the connection.
	//
	// > OAUTH tokens are refreshed when a 401 or 407 response is returned.
	AuthorizationType() *string
	SetAuthorizationType(val *string)
	// A `CreateConnectionAuthRequestParameters` object that contains the authorization parameters to use to authorize with the endpoint.
	AuthParameters() interface{}
	SetAuthParameters(val interface{})
	// 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
	// A description for the connection to create.
	Description() *string
	SetDescription(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 name for the connection to create.
	Name() *string
	SetName(val *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 stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	Stack() awscdk.Stack
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//    "GlobalSecondaryIndexes": [
	//      {
	//        "Projection": {
	//          "NonKeyAttributes": [ "myattribute" ]
	//          ...
	//        }
	//        ...
	//      },
	//      {
	//        "ProjectionType": "INCLUDE"
	//        ...
	//      },
	//    ]
	//    ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

A CloudFormation `AWS::Events::Connection`.

Creates a connection. A connection defines the authorization type and credentials to use for authorization with an API destination HTTP endpoint.

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"

cfnConnection := awscdk.Aws_events.NewCfnConnection(this, jsii.String("MyCfnConnection"), &cfnConnectionProps{
	authorizationType: jsii.String("authorizationType"),
	authParameters: &authParametersProperty{
		apiKeyAuthParameters: &apiKeyAuthParametersProperty{
			apiKeyName: jsii.String("apiKeyName"),
			apiKeyValue: jsii.String("apiKeyValue"),
		},
		basicAuthParameters: &basicAuthParametersProperty{
			password: jsii.String("password"),
			username: jsii.String("username"),
		},
		invocationHttpParameters: &connectionHttpParametersProperty{
			bodyParameters: []interface{}{
				&parameterProperty{
					key: jsii.String("key"),
					value: jsii.String("value"),

					// the properties below are optional
					isValueSecret: jsii.Boolean(false),
				},
			},
			headerParameters: []interface{}{
				&parameterProperty{
					key: jsii.String("key"),
					value: jsii.String("value"),

					// the properties below are optional
					isValueSecret: jsii.Boolean(false),
				},
			},
			queryStringParameters: []interface{}{
				&parameterProperty{
					key: jsii.String("key"),
					value: jsii.String("value"),

					// the properties below are optional
					isValueSecret: jsii.Boolean(false),
				},
			},
		},
		oAuthParameters: &oAuthParametersProperty{
			authorizationEndpoint: jsii.String("authorizationEndpoint"),
			clientParameters: &clientParametersProperty{
				clientId: jsii.String("clientId"),
				clientSecret: jsii.String("clientSecret"),
			},
			httpMethod: jsii.String("httpMethod"),

			// the properties below are optional
			oAuthHttpParameters: &connectionHttpParametersProperty{
				bodyParameters: []interface{}{
					&parameterProperty{
						key: jsii.String("key"),
						value: jsii.String("value"),

						// the properties below are optional
						isValueSecret: jsii.Boolean(false),
					},
				},
				headerParameters: []interface{}{
					&parameterProperty{
						key: jsii.String("key"),
						value: jsii.String("value"),

						// the properties below are optional
						isValueSecret: jsii.Boolean(false),
					},
				},
				queryStringParameters: []interface{}{
					&parameterProperty{
						key: jsii.String("key"),
						value: jsii.String("value"),

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

	// the properties below are optional
	description: jsii.String("description"),
	name: jsii.String("name"),
})

func NewCfnConnection

func NewCfnConnection(scope constructs.Construct, id *string, props *CfnConnectionProps) CfnConnection

Create a new `AWS::Events::Connection`.

type CfnConnectionProps

type CfnConnectionProps struct {
	// The type of authorization to use for the connection.
	//
	// > OAUTH tokens are refreshed when a 401 or 407 response is returned.
	AuthorizationType *string `field:"required" json:"authorizationType" yaml:"authorizationType"`
	// A `CreateConnectionAuthRequestParameters` object that contains the authorization parameters to use to authorize with the endpoint.
	AuthParameters interface{} `field:"required" json:"authParameters" yaml:"authParameters"`
	// A description for the connection to create.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The name for the connection to create.
	Name *string `field:"optional" json:"name" yaml:"name"`
}

Properties for defining a `CfnConnection`.

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"

cfnConnectionProps := &cfnConnectionProps{
	authorizationType: jsii.String("authorizationType"),
	authParameters: &authParametersProperty{
		apiKeyAuthParameters: &apiKeyAuthParametersProperty{
			apiKeyName: jsii.String("apiKeyName"),
			apiKeyValue: jsii.String("apiKeyValue"),
		},
		basicAuthParameters: &basicAuthParametersProperty{
			password: jsii.String("password"),
			username: jsii.String("username"),
		},
		invocationHttpParameters: &connectionHttpParametersProperty{
			bodyParameters: []interface{}{
				&parameterProperty{
					key: jsii.String("key"),
					value: jsii.String("value"),

					// the properties below are optional
					isValueSecret: jsii.Boolean(false),
				},
			},
			headerParameters: []interface{}{
				&parameterProperty{
					key: jsii.String("key"),
					value: jsii.String("value"),

					// the properties below are optional
					isValueSecret: jsii.Boolean(false),
				},
			},
			queryStringParameters: []interface{}{
				&parameterProperty{
					key: jsii.String("key"),
					value: jsii.String("value"),

					// the properties below are optional
					isValueSecret: jsii.Boolean(false),
				},
			},
		},
		oAuthParameters: &oAuthParametersProperty{
			authorizationEndpoint: jsii.String("authorizationEndpoint"),
			clientParameters: &clientParametersProperty{
				clientId: jsii.String("clientId"),
				clientSecret: jsii.String("clientSecret"),
			},
			httpMethod: jsii.String("httpMethod"),

			// the properties below are optional
			oAuthHttpParameters: &connectionHttpParametersProperty{
				bodyParameters: []interface{}{
					&parameterProperty{
						key: jsii.String("key"),
						value: jsii.String("value"),

						// the properties below are optional
						isValueSecret: jsii.Boolean(false),
					},
				},
				headerParameters: []interface{}{
					&parameterProperty{
						key: jsii.String("key"),
						value: jsii.String("value"),

						// the properties below are optional
						isValueSecret: jsii.Boolean(false),
					},
				},
				queryStringParameters: []interface{}{
					&parameterProperty{
						key: jsii.String("key"),
						value: jsii.String("value"),

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

	// the properties below are optional
	description: jsii.String("description"),
	name: jsii.String("name"),
}

type CfnConnection_ApiKeyAuthParametersProperty added in v2.15.0

type CfnConnection_ApiKeyAuthParametersProperty struct {
	// The name of the API key to use for authorization.
	ApiKeyName *string `field:"required" json:"apiKeyName" yaml:"apiKeyName"`
	// The value for the API key to use for authorization.
	ApiKeyValue *string `field:"required" json:"apiKeyValue" yaml:"apiKeyValue"`
}

Contains the API key authorization parameters for the connection.

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"

apiKeyAuthParametersProperty := &apiKeyAuthParametersProperty{
	apiKeyName: jsii.String("apiKeyName"),
	apiKeyValue: jsii.String("apiKeyValue"),
}

type CfnConnection_AuthParametersProperty added in v2.15.0

type CfnConnection_AuthParametersProperty struct {
	// The API Key parameters to use for authorization.
	ApiKeyAuthParameters interface{} `field:"optional" json:"apiKeyAuthParameters" yaml:"apiKeyAuthParameters"`
	// The authorization parameters for Basic authorization.
	BasicAuthParameters interface{} `field:"optional" json:"basicAuthParameters" yaml:"basicAuthParameters"`
	// Additional parameters for the connection that are passed through with every invocation to the HTTP endpoint.
	InvocationHttpParameters interface{} `field:"optional" json:"invocationHttpParameters" yaml:"invocationHttpParameters"`
	// The OAuth parameters to use for authorization.
	OAuthParameters interface{} `field:"optional" json:"oAuthParameters" yaml:"oAuthParameters"`
}

Contains the authorization parameters to use for the connection.

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"

authParametersProperty := &authParametersProperty{
	apiKeyAuthParameters: &apiKeyAuthParametersProperty{
		apiKeyName: jsii.String("apiKeyName"),
		apiKeyValue: jsii.String("apiKeyValue"),
	},
	basicAuthParameters: &basicAuthParametersProperty{
		password: jsii.String("password"),
		username: jsii.String("username"),
	},
	invocationHttpParameters: &connectionHttpParametersProperty{
		bodyParameters: []interface{}{
			&parameterProperty{
				key: jsii.String("key"),
				value: jsii.String("value"),

				// the properties below are optional
				isValueSecret: jsii.Boolean(false),
			},
		},
		headerParameters: []interface{}{
			&parameterProperty{
				key: jsii.String("key"),
				value: jsii.String("value"),

				// the properties below are optional
				isValueSecret: jsii.Boolean(false),
			},
		},
		queryStringParameters: []interface{}{
			&parameterProperty{
				key: jsii.String("key"),
				value: jsii.String("value"),

				// the properties below are optional
				isValueSecret: jsii.Boolean(false),
			},
		},
	},
	oAuthParameters: &oAuthParametersProperty{
		authorizationEndpoint: jsii.String("authorizationEndpoint"),
		clientParameters: &clientParametersProperty{
			clientId: jsii.String("clientId"),
			clientSecret: jsii.String("clientSecret"),
		},
		httpMethod: jsii.String("httpMethod"),

		// the properties below are optional
		oAuthHttpParameters: &connectionHttpParametersProperty{
			bodyParameters: []interface{}{
				&parameterProperty{
					key: jsii.String("key"),
					value: jsii.String("value"),

					// the properties below are optional
					isValueSecret: jsii.Boolean(false),
				},
			},
			headerParameters: []interface{}{
				&parameterProperty{
					key: jsii.String("key"),
					value: jsii.String("value"),

					// the properties below are optional
					isValueSecret: jsii.Boolean(false),
				},
			},
			queryStringParameters: []interface{}{
				&parameterProperty{
					key: jsii.String("key"),
					value: jsii.String("value"),

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

type CfnConnection_BasicAuthParametersProperty added in v2.15.0

type CfnConnection_BasicAuthParametersProperty struct {
	// The password associated with the user name to use for Basic authorization.
	Password *string `field:"required" json:"password" yaml:"password"`
	// The user name to use for Basic authorization.
	Username *string `field:"required" json:"username" yaml:"username"`
}

Contains the Basic authorization parameters for the connection.

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"

basicAuthParametersProperty := &basicAuthParametersProperty{
	password: jsii.String("password"),
	username: jsii.String("username"),
}

type CfnConnection_ClientParametersProperty added in v2.15.0

type CfnConnection_ClientParametersProperty struct {
	// The client ID to use for OAuth authorization.
	ClientId *string `field:"required" json:"clientId" yaml:"clientId"`
	// The client secret assciated with the client ID to use for OAuth authorization.
	ClientSecret *string `field:"required" json:"clientSecret" yaml:"clientSecret"`
}

Contains the OAuth authorization parameters to use for the connection.

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"

clientParametersProperty := &clientParametersProperty{
	clientId: jsii.String("clientId"),
	clientSecret: jsii.String("clientSecret"),
}

type CfnConnection_ConnectionHttpParametersProperty added in v2.15.0

type CfnConnection_ConnectionHttpParametersProperty struct {
	// Contains additional body string parameters for the connection.
	BodyParameters interface{} `field:"optional" json:"bodyParameters" yaml:"bodyParameters"`
	// Contains additional header parameters for the connection.
	HeaderParameters interface{} `field:"optional" json:"headerParameters" yaml:"headerParameters"`
	// Contains additional query string parameters for the connection.
	QueryStringParameters interface{} `field:"optional" json:"queryStringParameters" yaml:"queryStringParameters"`
}

Contains additional parameters for the connection.

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"

connectionHttpParametersProperty := &connectionHttpParametersProperty{
	bodyParameters: []interface{}{
		&parameterProperty{
			key: jsii.String("key"),
			value: jsii.String("value"),

			// the properties below are optional
			isValueSecret: jsii.Boolean(false),
		},
	},
	headerParameters: []interface{}{
		&parameterProperty{
			key: jsii.String("key"),
			value: jsii.String("value"),

			// the properties below are optional
			isValueSecret: jsii.Boolean(false),
		},
	},
	queryStringParameters: []interface{}{
		&parameterProperty{
			key: jsii.String("key"),
			value: jsii.String("value"),

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

type CfnConnection_OAuthParametersProperty added in v2.15.0

type CfnConnection_OAuthParametersProperty struct {
	// The URL to the authorization endpoint when OAuth is specified as the authorization type.
	AuthorizationEndpoint *string `field:"required" json:"authorizationEndpoint" yaml:"authorizationEndpoint"`
	// A `CreateConnectionOAuthClientRequestParameters` object that contains the client parameters for OAuth authorization.
	ClientParameters interface{} `field:"required" json:"clientParameters" yaml:"clientParameters"`
	// The method to use for the authorization request.
	HttpMethod *string `field:"required" json:"httpMethod" yaml:"httpMethod"`
	// A `ConnectionHttpParameters` object that contains details about the additional parameters to use for the connection.
	OAuthHttpParameters interface{} `field:"optional" json:"oAuthHttpParameters" yaml:"oAuthHttpParameters"`
}

Contains the OAuth authorization parameters to use for the connection.

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"

oAuthParametersProperty := &oAuthParametersProperty{
	authorizationEndpoint: jsii.String("authorizationEndpoint"),
	clientParameters: &clientParametersProperty{
		clientId: jsii.String("clientId"),
		clientSecret: jsii.String("clientSecret"),
	},
	httpMethod: jsii.String("httpMethod"),

	// the properties below are optional
	oAuthHttpParameters: &connectionHttpParametersProperty{
		bodyParameters: []interface{}{
			&parameterProperty{
				key: jsii.String("key"),
				value: jsii.String("value"),

				// the properties below are optional
				isValueSecret: jsii.Boolean(false),
			},
		},
		headerParameters: []interface{}{
			&parameterProperty{
				key: jsii.String("key"),
				value: jsii.String("value"),

				// the properties below are optional
				isValueSecret: jsii.Boolean(false),
			},
		},
		queryStringParameters: []interface{}{
			&parameterProperty{
				key: jsii.String("key"),
				value: jsii.String("value"),

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

type CfnConnection_ParameterProperty added in v2.15.0

type CfnConnection_ParameterProperty struct {
	// The key for a query string parameter.
	Key *string `field:"required" json:"key" yaml:"key"`
	// The value associated with the key for the query string parameter.
	Value *string `field:"required" json:"value" yaml:"value"`
	// Specifies whether the value is secret.
	IsValueSecret interface{} `field:"optional" json:"isValueSecret" yaml:"isValueSecret"`
}

Additional query string parameter for the connection.

You can include up to 100 additional query string parameters per request. Each additional parameter counts towards the event payload size, which cannot exceed 64 KB.

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"

parameterProperty := &parameterProperty{
	key: jsii.String("key"),
	value: jsii.String("value"),

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

type CfnEndpoint added in v2.21.0

type CfnEndpoint interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// The ARN of the endpoint.
	AttrArn() *string
	// The ID of the endpoint.
	AttrEndpointId() *string
	// The URL of the endpoint.
	AttrEndpointUrl() *string
	// The current state of the endpoint.
	AttrState() *string
	// The reason the endpoint is in its current state.
	AttrStateReason() *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
	// A description for the endpoint.
	Description() *string
	SetDescription(val *string)
	// The event buses being used by the endpoint.
	//
	// *Exactly* : `2`.
	EventBuses() interface{}
	SetEventBuses(val interface{})
	// 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 name of the endpoint.
	Name() *string
	SetName(val *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
	// Whether event replication was enabled or disabled for this endpoint.
	//
	// The default state is `ENABLED` which means you must supply a `RoleArn` . If you don't have a `RoleArn` or you don't want event replication enabled, set the state to `DISABLED` .
	ReplicationConfig() interface{}
	SetReplicationConfig(val interface{})
	// The ARN of the role used by event replication for the endpoint.
	RoleArn() *string
	SetRoleArn(val *string)
	// The routing configuration of the endpoint.
	RoutingConfig() interface{}
	SetRoutingConfig(val interface{})
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	Stack() awscdk.Stack
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//    "GlobalSecondaryIndexes": [
	//      {
	//        "Projection": {
	//          "NonKeyAttributes": [ "myattribute" ]
	//          ...
	//        }
	//        ...
	//      },
	//      {
	//        "ProjectionType": "INCLUDE"
	//        ...
	//      },
	//    ]
	//    ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

A CloudFormation `AWS::Events::Endpoint`.

A global endpoint used to improve your application's availability by making it regional-fault tolerant. For more information about global endpoints, see [Making applications Regional-fault tolerant with global endpoints and event replication](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-global-endpoints.html) in the Amazon EventBridge 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"

cfnEndpoint := awscdk.Aws_events.NewCfnEndpoint(this, jsii.String("MyCfnEndpoint"), &cfnEndpointProps{
	eventBuses: []interface{}{
		&endpointEventBusProperty{
			eventBusArn: jsii.String("eventBusArn"),
		},
	},
	name: jsii.String("name"),
	routingConfig: &routingConfigProperty{
		failoverConfig: &failoverConfigProperty{
			primary: &primaryProperty{
				healthCheck: jsii.String("healthCheck"),
			},
			secondary: &secondaryProperty{
				route: jsii.String("route"),
			},
		},
	},

	// the properties below are optional
	description: jsii.String("description"),
	replicationConfig: &replicationConfigProperty{
		state: jsii.String("state"),
	},
	roleArn: jsii.String("roleArn"),
})

func NewCfnEndpoint added in v2.21.0

func NewCfnEndpoint(scope constructs.Construct, id *string, props *CfnEndpointProps) CfnEndpoint

Create a new `AWS::Events::Endpoint`.

type CfnEndpointProps added in v2.21.0

type CfnEndpointProps struct {
	// The event buses being used by the endpoint.
	//
	// *Exactly* : `2`.
	EventBuses interface{} `field:"required" json:"eventBuses" yaml:"eventBuses"`
	// The name of the endpoint.
	Name *string `field:"required" json:"name" yaml:"name"`
	// The routing configuration of the endpoint.
	RoutingConfig interface{} `field:"required" json:"routingConfig" yaml:"routingConfig"`
	// A description for the endpoint.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// Whether event replication was enabled or disabled for this endpoint.
	//
	// The default state is `ENABLED` which means you must supply a `RoleArn` . If you don't have a `RoleArn` or you don't want event replication enabled, set the state to `DISABLED` .
	ReplicationConfig interface{} `field:"optional" json:"replicationConfig" yaml:"replicationConfig"`
	// The ARN of the role used by event replication for the endpoint.
	RoleArn *string `field:"optional" json:"roleArn" yaml:"roleArn"`
}

Properties for defining a `CfnEndpoint`.

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"

cfnEndpointProps := &cfnEndpointProps{
	eventBuses: []interface{}{
		&endpointEventBusProperty{
			eventBusArn: jsii.String("eventBusArn"),
		},
	},
	name: jsii.String("name"),
	routingConfig: &routingConfigProperty{
		failoverConfig: &failoverConfigProperty{
			primary: &primaryProperty{
				healthCheck: jsii.String("healthCheck"),
			},
			secondary: &secondaryProperty{
				route: jsii.String("route"),
			},
		},
	},

	// the properties below are optional
	description: jsii.String("description"),
	replicationConfig: &replicationConfigProperty{
		state: jsii.String("state"),
	},
	roleArn: jsii.String("roleArn"),
}

type CfnEndpoint_EndpointEventBusProperty added in v2.21.0

type CfnEndpoint_EndpointEventBusProperty struct {
	// The ARN of the event bus the endpoint is associated with.
	EventBusArn *string `field:"required" json:"eventBusArn" yaml:"eventBusArn"`
}

The event buses the endpoint is associated with.

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"

endpointEventBusProperty := &endpointEventBusProperty{
	eventBusArn: jsii.String("eventBusArn"),
}

type CfnEndpoint_FailoverConfigProperty added in v2.21.0

type CfnEndpoint_FailoverConfigProperty struct {
	// The main Region of the endpoint.
	Primary interface{} `field:"required" json:"primary" yaml:"primary"`
	// The Region that events are routed to when failover is triggered or event replication is enabled.
	Secondary interface{} `field:"required" json:"secondary" yaml:"secondary"`
}

The failover configuration for an endpoint.

This includes what triggers failover and what happens when it's triggered.

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"

failoverConfigProperty := &failoverConfigProperty{
	primary: &primaryProperty{
		healthCheck: jsii.String("healthCheck"),
	},
	secondary: &secondaryProperty{
		route: jsii.String("route"),
	},
}

type CfnEndpoint_PrimaryProperty added in v2.21.0

type CfnEndpoint_PrimaryProperty struct {
	// The ARN of the health check used by the endpoint to determine whether failover is triggered.
	HealthCheck *string `field:"required" json:"healthCheck" yaml:"healthCheck"`
}

The primary Region of the endpoint.

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"

primaryProperty := &primaryProperty{
	healthCheck: jsii.String("healthCheck"),
}

type CfnEndpoint_ReplicationConfigProperty added in v2.21.0

type CfnEndpoint_ReplicationConfigProperty struct {
	// The state of event replication.
	State *string `field:"required" json:"state" yaml:"state"`
}

Endpoints can replicate all events to the secondary Region.

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"

replicationConfigProperty := &replicationConfigProperty{
	state: jsii.String("state"),
}

type CfnEndpoint_RoutingConfigProperty added in v2.21.0

type CfnEndpoint_RoutingConfigProperty struct {
	// The failover configuration for an endpoint.
	//
	// This includes what triggers failover and what happens when it's triggered.
	FailoverConfig interface{} `field:"required" json:"failoverConfig" yaml:"failoverConfig"`
}

The routing configuration of the endpoint.

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"

routingConfigProperty := &routingConfigProperty{
	failoverConfig: &failoverConfigProperty{
		primary: &primaryProperty{
			healthCheck: jsii.String("healthCheck"),
		},
		secondary: &secondaryProperty{
			route: jsii.String("route"),
		},
	},
}

type CfnEndpoint_SecondaryProperty added in v2.21.0

type CfnEndpoint_SecondaryProperty struct {
	// Defines the secondary Region.
	Route *string `field:"required" json:"route" yaml:"route"`
}

The secondary Region that processes events when failover is triggered or replication is enabled.

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"

secondaryProperty := &secondaryProperty{
	route: jsii.String("route"),
}

type CfnEventBus

type CfnEventBus interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// The ARN of the event bus, such as `arn:aws:events:us-east-2:123456789012:event-bus/aws.partner/PartnerName/acct1/repo1` .
	AttrArn() *string
	// The name of the event bus, such as `PartnerName/acct1/repo1` .
	AttrName() *string
	// The policy for the event bus in JSON form.
	AttrPolicy() *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
	// If you are creating a partner event bus, this specifies the partner event source that the new event bus will be matched with.
	EventSourceName() *string
	SetEventSourceName(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 name of the new event bus.
	//
	// Event bus names cannot contain the / character. You can't use the name `default` for a custom event bus, as this name is already used for your account's default event bus.
	//
	// If this is a partner event bus, the name must exactly match the name of the partner event source that this event bus is matched to.
	Name() *string
	SetName(val *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 stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	Stack() awscdk.Stack
	// Tags to associate with the event bus.
	Tags() *[]*CfnEventBus_TagEntryProperty
	SetTags(val *[]*CfnEventBus_TagEntryProperty)
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//    "GlobalSecondaryIndexes": [
	//      {
	//        "Projection": {
	//          "NonKeyAttributes": [ "myattribute" ]
	//          ...
	//        }
	//        ...
	//      },
	//      {
	//        "ProjectionType": "INCLUDE"
	//        ...
	//      },
	//    ]
	//    ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

A CloudFormation `AWS::Events::EventBus`.

Creates a new event bus within your account. This can be a custom event bus which you can use to receive events from your custom applications and services, or it can be a partner event bus which can be matched to a partner event source.

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"

cfnEventBus := awscdk.Aws_events.NewCfnEventBus(this, jsii.String("MyCfnEventBus"), &cfnEventBusProps{
	name: jsii.String("name"),

	// the properties below are optional
	eventSourceName: jsii.String("eventSourceName"),
	tags: []tagEntryProperty{
		&tagEntryProperty{
			key: jsii.String("key"),
			value: jsii.String("value"),
		},
	},
})

func NewCfnEventBus

func NewCfnEventBus(scope constructs.Construct, id *string, props *CfnEventBusProps) CfnEventBus

Create a new `AWS::Events::EventBus`.

type CfnEventBusPolicy

type CfnEventBusPolicy interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// The action that you are enabling the other account to perform.
	Action() *string
	SetAction(val *string)
	// Options for this resource, such as condition, update policy etc.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	CfnResourceType() *string
	// This parameter enables you to limit the permission to accounts that fulfill a certain condition, such as being a member of a certain AWS organization.
	//
	// For more information about AWS Organizations, see [What Is AWS Organizations](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html) in the *AWS Organizations User Guide* .
	//
	// If you specify `Condition` with an AWS organization ID, and specify "*" as the value for `Principal` , you grant permission to all the accounts in the named organization.
	//
	// The `Condition` is a JSON string which must contain `Type` , `Key` , and `Value` fields.
	Condition() interface{}
	SetCondition(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 name of the event bus associated with the rule.
	//
	// If you omit this, the default event bus is used.
	EventBusName() *string
	SetEventBusName(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 12-digit AWS account ID that you are permitting to put events to your default event bus.
	//
	// Specify "*" to permit any account to put events to your default event bus.
	//
	// If you specify "*" without specifying `Condition` , avoid creating rules that may match undesirable events. To create more secure rules, make sure that the event pattern for each rule contains an `account` field with a specific account ID from which to receive events. Rules with an account field do not match any events sent from other accounts.
	Principal() *string
	SetPrincipal(val *string)
	// 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
	// A JSON string that describes the permission policy statement.
	//
	// You can include a `Policy` parameter in the request instead of using the `StatementId` , `Action` , `Principal` , or `Condition` parameters.
	Statement() interface{}
	SetStatement(val interface{})
	// An identifier string for the external account that you are granting permissions to.
	//
	// If you later want to revoke the permission for this external account, specify this `StatementId` when you run [RemovePermission](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_RemovePermission.html) .
	//
	// > Each `StatementId` must be unique.
	StatementId() *string
	SetStatementId(val *string)
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//    "GlobalSecondaryIndexes": [
	//      {
	//        "Projection": {
	//          "NonKeyAttributes": [ "myattribute" ]
	//          ...
	//        }
	//        ...
	//      },
	//      {
	//        "ProjectionType": "INCLUDE"
	//        ...
	//      },
	//    ]
	//    ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

A CloudFormation `AWS::Events::EventBusPolicy`.

Running `PutPermission` permits the specified AWS account or AWS organization to put events to the specified *event bus* . Amazon EventBridge (CloudWatch Events) rules in your account are triggered by these events arriving to an event bus in your account.

For another account to send events to your account, that external account must have an EventBridge rule with your account's event bus as a target.

To enable multiple AWS accounts to put events to your event bus, run `PutPermission` once for each of these accounts. Or, if all the accounts are members of the same AWS organization, you can run `PutPermission` once specifying `Principal` as "*" and specifying the AWS organization ID in `Condition` , to grant permissions to all accounts in that organization.

If you grant permissions using an organization, then accounts in that organization must specify a `RoleArn` with proper permissions when they use `PutTarget` to add your account's event bus as a target. For more information, see [Sending and Receiving Events Between AWS Accounts](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-cross-account-event-delivery.html) in the *Amazon EventBridge User Guide* .

The permission policy on the event bus cannot exceed 10 KB in size.

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

cfnEventBusPolicy := awscdk.Aws_events.NewCfnEventBusPolicy(this, jsii.String("MyCfnEventBusPolicy"), &cfnEventBusPolicyProps{
	statementId: jsii.String("statementId"),

	// the properties below are optional
	action: jsii.String("action"),
	condition: &conditionProperty{
		key: jsii.String("key"),
		type: jsii.String("type"),
		value: jsii.String("value"),
	},
	eventBusName: jsii.String("eventBusName"),
	principal: jsii.String("principal"),
	statement: statement,
})

func NewCfnEventBusPolicy

func NewCfnEventBusPolicy(scope constructs.Construct, id *string, props *CfnEventBusPolicyProps) CfnEventBusPolicy

Create a new `AWS::Events::EventBusPolicy`.

type CfnEventBusPolicyProps

type CfnEventBusPolicyProps struct {
	// An identifier string for the external account that you are granting permissions to.
	//
	// If you later want to revoke the permission for this external account, specify this `StatementId` when you run [RemovePermission](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_RemovePermission.html) .
	//
	// > Each `StatementId` must be unique.
	StatementId *string `field:"required" json:"statementId" yaml:"statementId"`
	// The action that you are enabling the other account to perform.
	Action *string `field:"optional" json:"action" yaml:"action"`
	// This parameter enables you to limit the permission to accounts that fulfill a certain condition, such as being a member of a certain AWS organization.
	//
	// For more information about AWS Organizations, see [What Is AWS Organizations](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html) in the *AWS Organizations User Guide* .
	//
	// If you specify `Condition` with an AWS organization ID, and specify "*" as the value for `Principal` , you grant permission to all the accounts in the named organization.
	//
	// The `Condition` is a JSON string which must contain `Type` , `Key` , and `Value` fields.
	Condition interface{} `field:"optional" json:"condition" yaml:"condition"`
	// The name of the event bus associated with the rule.
	//
	// If you omit this, the default event bus is used.
	EventBusName *string `field:"optional" json:"eventBusName" yaml:"eventBusName"`
	// The 12-digit AWS account ID that you are permitting to put events to your default event bus.
	//
	// Specify "*" to permit any account to put events to your default event bus.
	//
	// If you specify "*" without specifying `Condition` , avoid creating rules that may match undesirable events. To create more secure rules, make sure that the event pattern for each rule contains an `account` field with a specific account ID from which to receive events. Rules with an account field do not match any events sent from other accounts.
	Principal *string `field:"optional" json:"principal" yaml:"principal"`
	// A JSON string that describes the permission policy statement.
	//
	// You can include a `Policy` parameter in the request instead of using the `StatementId` , `Action` , `Principal` , or `Condition` parameters.
	Statement interface{} `field:"optional" json:"statement" yaml:"statement"`
}

Properties for defining a `CfnEventBusPolicy`.

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

cfnEventBusPolicyProps := &cfnEventBusPolicyProps{
	statementId: jsii.String("statementId"),

	// the properties below are optional
	action: jsii.String("action"),
	condition: &conditionProperty{
		key: jsii.String("key"),
		type: jsii.String("type"),
		value: jsii.String("value"),
	},
	eventBusName: jsii.String("eventBusName"),
	principal: jsii.String("principal"),
	statement: statement,
}

type CfnEventBusPolicy_ConditionProperty

type CfnEventBusPolicy_ConditionProperty struct {
	// Specifies the key for the condition.
	//
	// Currently the only supported key is `aws:PrincipalOrgID` .
	Key *string `field:"optional" json:"key" yaml:"key"`
	// Specifies the type of condition.
	//
	// Currently the only supported value is `StringEquals` .
	Type *string `field:"optional" json:"type" yaml:"type"`
	// Specifies the value for the key.
	//
	// Currently, this must be the ID of the organization.
	Value *string `field:"optional" json:"value" yaml:"value"`
}

A JSON string which you can use to limit the event bus permissions you are granting to only accounts that fulfill the condition.

Currently, the only supported condition is membership in a certain AWS organization. The string must contain `Type` , `Key` , and `Value` fields. The `Value` field specifies the ID of the AWS organization. Following is an example value for `Condition` :

`'{"Type" : "StringEquals", "Key": "aws:PrincipalOrgID", "Value": "o-1234567890"}'`.

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"

conditionProperty := &conditionProperty{
	key: jsii.String("key"),
	type: jsii.String("type"),
	value: jsii.String("value"),
}

type CfnEventBusProps

type CfnEventBusProps struct {
	// The name of the new event bus.
	//
	// Event bus names cannot contain the / character. You can't use the name `default` for a custom event bus, as this name is already used for your account's default event bus.
	//
	// If this is a partner event bus, the name must exactly match the name of the partner event source that this event bus is matched to.
	Name *string `field:"required" json:"name" yaml:"name"`
	// If you are creating a partner event bus, this specifies the partner event source that the new event bus will be matched with.
	EventSourceName *string `field:"optional" json:"eventSourceName" yaml:"eventSourceName"`
	// Tags to associate with the event bus.
	Tags *[]*CfnEventBus_TagEntryProperty `field:"optional" json:"tags" yaml:"tags"`
}

Properties for defining a `CfnEventBus`.

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"

cfnEventBusProps := &cfnEventBusProps{
	name: jsii.String("name"),

	// the properties below are optional
	eventSourceName: jsii.String("eventSourceName"),
	tags: []tagEntryProperty{
		&tagEntryProperty{
			key: jsii.String("key"),
			value: jsii.String("value"),
		},
	},
}

type CfnEventBus_TagEntryProperty added in v2.9.0

type CfnEventBus_TagEntryProperty struct {
	// A string you can use to assign a value.
	//
	// The combination of tag keys and values can help you organize and categorize your resources.
	Key *string `field:"required" json:"key" yaml:"key"`
	// The value for the specified tag key.
	Value *string `field:"required" json:"value" yaml:"value"`
}

A key-value pair associated with an AWS resource.

In EventBridge, rules and event buses support tagging.

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"

tagEntryProperty := &tagEntryProperty{
	key: jsii.String("key"),
	value: jsii.String("value"),
}

type CfnRule

type CfnRule interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// The ARN of the rule, such as `arn:aws:events:us-east-2:123456789012:rule/example` .
	AttrArn() *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 description of the rule.
	Description() *string
	SetDescription(val *string)
	// The name or ARN of the event bus associated with the rule.
	//
	// If you omit this, the default event bus is used.
	EventBusName() *string
	SetEventBusName(val *string)
	// The event pattern of the rule.
	//
	// For more information, see [Events and Event Patterns](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) in the *Amazon EventBridge User Guide* .
	EventPattern() interface{}
	SetEventPattern(val interface{})
	// 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 name of the rule.
	Name() *string
	SetName(val *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 Amazon Resource Name (ARN) of the role that is used for target invocation.
	//
	// If you're setting an event bus in another account as the target and that account granted permission to your account through an organization instead of directly by the account ID, you must specify a `RoleArn` with proper permissions in the `Target` structure, instead of here in this parameter.
	RoleArn() *string
	SetRoleArn(val *string)
	// The scheduling expression.
	//
	// For example, "cron(0 20 * * ? *)", "rate(5 minutes)". For more information, see [Creating an Amazon EventBridge rule that runs on a schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-rule-schedule.html) .
	ScheduleExpression() *string
	SetScheduleExpression(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 state of the rule.
	State() *string
	SetState(val *string)
	// Adds the specified targets to the specified rule, or updates the targets if they are already associated with the rule.
	//
	// Targets are the resources that are invoked when a rule is triggered.
	//
	// > Each rule can have up to five (5) targets associated with it at one time.
	//
	// You can configure the following as targets for Events:
	//
	// - [API destination](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-api-destinations.html)
	// - [API Gateway](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-api-gateway-target.html)
	// - Batch job queue
	// - CloudWatch group
	// - CodeBuild project
	// - CodePipeline
	// - EC2 `CreateSnapshot` API call
	// - EC2 Image Builder
	// - EC2 `RebootInstances` API call
	// - EC2 `StopInstances` API call
	// - EC2 `TerminateInstances` API call
	// - ECS task
	// - [Event bus in a different account or Region](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-cross-account.html)
	// - [Event bus in the same account and Region](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-bus-to-bus.html)
	// - Firehose delivery stream
	// - Glue workflow
	// - [Incident Manager response plan](https://docs.aws.amazon.com//incident-manager/latest/userguide/incident-creation.html#incident-tracking-auto-eventbridge)
	// - Inspector assessment template
	// - Kinesis stream
	// - Lambda function
	// - Redshift cluster
	// - SageMaker Pipeline
	// - SNS topic
	// - SQS queue
	// - Step Functions state machine
	// - Systems Manager Automation
	// - Systems Manager OpsItem
	// - Systems Manager Run Command
	//
	// Creating rules with built-in targets is supported only in the AWS Management Console . The built-in targets are `EC2 CreateSnapshot API call` , `EC2 RebootInstances API call` , `EC2 StopInstances API call` , and `EC2 TerminateInstances API call` .
	//
	// For some target types, `PutTargets` provides target-specific parameters. If the target is a Kinesis data stream, you can optionally specify which shard the event goes to by using the `KinesisParameters` argument. To invoke a command on multiple EC2 instances with one rule, you can use the `RunCommandParameters` field.
	//
	// To be able to make API calls against the resources that you own, Amazon EventBridge needs the appropriate permissions. For AWS Lambda and Amazon SNS resources, EventBridge relies on resource-based policies. For EC2 instances, Kinesis Data Streams, AWS Step Functions state machines and API Gateway REST APIs, EventBridge relies on IAM roles that you specify in the `RoleARN` argument in `PutTargets` . For more information, see [Authentication and Access Control](https://docs.aws.amazon.com/eventbridge/latest/userguide/auth-and-access-control-eventbridge.html) in the *Amazon EventBridge User Guide* .
	//
	// If another AWS account is in the same region and has granted you permission (using `PutPermission` ), you can send events to that account. Set that account's event bus as a target of the rules in your account. To send the matched events to the other account, specify that account's event bus as the `Arn` value when you run `PutTargets` . If your account sends events to another account, your account is charged for each sent event. Each event sent to another account is charged as a custom event. The account receiving the event is not charged. For more information, see [Amazon EventBridge Pricing](https://docs.aws.amazon.com/eventbridge/pricing/) .
	//
	// > `Input` , `InputPath` , and `InputTransformer` are not available with `PutTarget` if the target is an event bus of a different AWS account.
	//
	// If you are setting the event bus of another account as the target, and that account granted permission to your account through an organization instead of directly by the account ID, then you must specify a `RoleArn` with proper permissions in the `Target` structure. For more information, see [Sending and Receiving Events Between AWS Accounts](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-cross-account-event-delivery.html) in the *Amazon EventBridge User Guide* .
	//
	// For more information about enabling cross-account events, see [PutPermission](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutPermission.html) .
	//
	// *Input* , *InputPath* , and *InputTransformer* are mutually exclusive and optional parameters of a target. When a rule is triggered due to a matched event:
	//
	// - If none of the following arguments are specified for a target, then the entire event is passed to the target in JSON format (unless the target is Amazon EC2 Run Command or Amazon ECS task, in which case nothing from the event is passed to the target).
	// - If *Input* is specified in the form of valid JSON, then the matched event is overridden with this constant.
	// - If *InputPath* is specified in the form of JSONPath (for example, `$.detail` ), then only the part of the event specified in the path is passed to the target (for example, only the detail part of the event is passed).
	// - If *InputTransformer* is specified, then one or more specified JSONPaths are extracted from the event and used as values in a template that you specify as the input to the target.
	//
	// When you specify `InputPath` or `InputTransformer` , you must use JSON dot notation, not bracket notation.
	//
	// When you add targets to a rule and the associated rule triggers soon after, new or updated targets might not be immediately invoked. Allow a short period of time for changes to take effect.
	//
	// This action can partially fail if too many requests are made at the same time. If that happens, `FailedEntryCount` is non-zero in the response and each entry in `FailedEntries` provides the ID of the failed target and the error code.
	Targets() interface{}
	SetTargets(val interface{})
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//    "GlobalSecondaryIndexes": [
	//      {
	//        "Projection": {
	//          "NonKeyAttributes": [ "myattribute" ]
	//          ...
	//        }
	//        ...
	//      },
	//      {
	//        "ProjectionType": "INCLUDE"
	//        ...
	//      },
	//    ]
	//    ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

A CloudFormation `AWS::Events::Rule`.

Creates or updates the specified rule. Rules are enabled by default, or based on value of the state. You can disable a rule using [DisableRule](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_DisableRule.html) .

A single rule watches for events from a single event bus. Events generated by AWS services go to your account's default event bus. Events generated by SaaS partner services or applications go to the matching partner event bus. If you have custom applications or services, you can specify whether their events go to your default event bus or a custom event bus that you have created. For more information, see [CreateEventBus](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_CreateEventBus.html) .

If you are updating an existing rule, the rule is replaced with what you specify in this `PutRule` command. If you omit arguments in `PutRule` , the old values for those arguments are not kept. Instead, they are replaced with null values.

When you create or update a rule, incoming events might not immediately start matching to new or updated rules. Allow a short period of time for changes to take effect.

A rule must contain at least an EventPattern or ScheduleExpression. Rules with EventPatterns are triggered when a matching event is observed. Rules with ScheduleExpressions self-trigger based on the given schedule. A rule can have both an EventPattern and a ScheduleExpression, in which case the rule triggers on matching events as well as on a schedule.

Most services in AWS treat : or / as the same character in Amazon Resource Names (ARNs). However, EventBridge uses an exact match in event patterns and rules. Be sure to use the correct ARN characters when creating event patterns so that they match the ARN syntax in the event you want to match.

In EventBridge, it is possible to create rules that lead to infinite loops, where a rule is fired repeatedly. For example, a rule might detect that ACLs have changed on an S3 bucket, and trigger software to change them to the desired state. If the rule is not written carefully, the subsequent change to the ACLs fires the rule again, creating an infinite loop.

To prevent this, write the rules so that the triggered actions do not re-fire the same rule. For example, your rule could fire only if ACLs are found to be in a bad state, instead of after any change.

An infinite loop can quickly cause higher than expected charges. We recommend that you use budgeting, which alerts you when charges exceed your specified limit. For more information, see [Managing Your Costs with Budgets](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/budgets-managing-costs.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"

var eventPattern interface{}

cfnRule := awscdk.Aws_events.NewCfnRule(this, jsii.String("MyCfnRule"), &cfnRuleProps{
	description: jsii.String("description"),
	eventBusName: jsii.String("eventBusName"),
	eventPattern: eventPattern,
	name: jsii.String("name"),
	roleArn: jsii.String("roleArn"),
	scheduleExpression: jsii.String("scheduleExpression"),
	state: jsii.String("state"),
	targets: []interface{}{
		&targetProperty{
			arn: jsii.String("arn"),
			id: jsii.String("id"),

			// the properties below are optional
			batchParameters: &batchParametersProperty{
				jobDefinition: jsii.String("jobDefinition"),
				jobName: jsii.String("jobName"),

				// the properties below are optional
				arrayProperties: &batchArrayPropertiesProperty{
					size: jsii.Number(123),
				},
				retryStrategy: &batchRetryStrategyProperty{
					attempts: jsii.Number(123),
				},
			},
			deadLetterConfig: &deadLetterConfigProperty{
				arn: jsii.String("arn"),
			},
			ecsParameters: &ecsParametersProperty{
				taskDefinitionArn: jsii.String("taskDefinitionArn"),

				// the properties below are optional
				capacityProviderStrategy: []interface{}{
					&capacityProviderStrategyItemProperty{
						capacityProvider: jsii.String("capacityProvider"),

						// the properties below are optional
						base: jsii.Number(123),
						weight: jsii.Number(123),
					},
				},
				enableEcsManagedTags: jsii.Boolean(false),
				enableExecuteCommand: jsii.Boolean(false),
				group: jsii.String("group"),
				launchType: jsii.String("launchType"),
				networkConfiguration: &networkConfigurationProperty{
					awsVpcConfiguration: &awsVpcConfigurationProperty{
						subnets: []*string{
							jsii.String("subnets"),
						},

						// the properties below are optional
						assignPublicIp: jsii.String("assignPublicIp"),
						securityGroups: []*string{
							jsii.String("securityGroups"),
						},
					},
				},
				placementConstraints: []interface{}{
					&placementConstraintProperty{
						expression: jsii.String("expression"),
						type: jsii.String("type"),
					},
				},
				placementStrategies: []interface{}{
					&placementStrategyProperty{
						field: jsii.String("field"),
						type: jsii.String("type"),
					},
				},
				platformVersion: jsii.String("platformVersion"),
				propagateTags: jsii.String("propagateTags"),
				referenceId: jsii.String("referenceId"),
				tagList: []interface{}{
					&cfnTag{
						key: jsii.String("key"),
						value: jsii.String("value"),
					},
				},
				taskCount: jsii.Number(123),
			},
			httpParameters: &httpParametersProperty{
				headerParameters: map[string]*string{
					"headerParametersKey": jsii.String("headerParameters"),
				},
				pathParameterValues: []*string{
					jsii.String("pathParameterValues"),
				},
				queryStringParameters: map[string]*string{
					"queryStringParametersKey": jsii.String("queryStringParameters"),
				},
			},
			input: jsii.String("input"),
			inputPath: jsii.String("inputPath"),
			inputTransformer: &inputTransformerProperty{
				inputTemplate: jsii.String("inputTemplate"),

				// the properties below are optional
				inputPathsMap: map[string]*string{
					"inputPathsMapKey": jsii.String("inputPathsMap"),
				},
			},
			kinesisParameters: &kinesisParametersProperty{
				partitionKeyPath: jsii.String("partitionKeyPath"),
			},
			redshiftDataParameters: &redshiftDataParametersProperty{
				database: jsii.String("database"),
				sql: jsii.String("sql"),

				// the properties below are optional
				dbUser: jsii.String("dbUser"),
				secretManagerArn: jsii.String("secretManagerArn"),
				statementName: jsii.String("statementName"),
				withEvent: jsii.Boolean(false),
			},
			retryPolicy: &retryPolicyProperty{
				maximumEventAgeInSeconds: jsii.Number(123),
				maximumRetryAttempts: jsii.Number(123),
			},
			roleArn: jsii.String("roleArn"),
			runCommandParameters: &runCommandParametersProperty{
				runCommandTargets: []interface{}{
					&runCommandTargetProperty{
						key: jsii.String("key"),
						values: []*string{
							jsii.String("values"),
						},
					},
				},
			},
			sageMakerPipelineParameters: &sageMakerPipelineParametersProperty{
				pipelineParameterList: []interface{}{
					&sageMakerPipelineParameterProperty{
						name: jsii.String("name"),
						value: jsii.String("value"),
					},
				},
			},
			sqsParameters: &sqsParametersProperty{
				messageGroupId: jsii.String("messageGroupId"),
			},
		},
	},
})

func NewCfnRule

func NewCfnRule(scope constructs.Construct, id *string, props *CfnRuleProps) CfnRule

Create a new `AWS::Events::Rule`.

type CfnRuleProps

type CfnRuleProps struct {
	// The description of the rule.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The name or ARN of the event bus associated with the rule.
	//
	// If you omit this, the default event bus is used.
	EventBusName *string `field:"optional" json:"eventBusName" yaml:"eventBusName"`
	// The event pattern of the rule.
	//
	// For more information, see [Events and Event Patterns](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) in the *Amazon EventBridge User Guide* .
	EventPattern interface{} `field:"optional" json:"eventPattern" yaml:"eventPattern"`
	// The name of the rule.
	Name *string `field:"optional" json:"name" yaml:"name"`
	// The Amazon Resource Name (ARN) of the role that is used for target invocation.
	//
	// If you're setting an event bus in another account as the target and that account granted permission to your account through an organization instead of directly by the account ID, you must specify a `RoleArn` with proper permissions in the `Target` structure, instead of here in this parameter.
	RoleArn *string `field:"optional" json:"roleArn" yaml:"roleArn"`
	// The scheduling expression.
	//
	// For example, "cron(0 20 * * ? *)", "rate(5 minutes)". For more information, see [Creating an Amazon EventBridge rule that runs on a schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-rule-schedule.html) .
	ScheduleExpression *string `field:"optional" json:"scheduleExpression" yaml:"scheduleExpression"`
	// The state of the rule.
	State *string `field:"optional" json:"state" yaml:"state"`
	// Adds the specified targets to the specified rule, or updates the targets if they are already associated with the rule.
	//
	// Targets are the resources that are invoked when a rule is triggered.
	//
	// > Each rule can have up to five (5) targets associated with it at one time.
	//
	// You can configure the following as targets for Events:
	//
	// - [API destination](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-api-destinations.html)
	// - [API Gateway](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-api-gateway-target.html)
	// - Batch job queue
	// - CloudWatch group
	// - CodeBuild project
	// - CodePipeline
	// - EC2 `CreateSnapshot` API call
	// - EC2 Image Builder
	// - EC2 `RebootInstances` API call
	// - EC2 `StopInstances` API call
	// - EC2 `TerminateInstances` API call
	// - ECS task
	// - [Event bus in a different account or Region](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-cross-account.html)
	// - [Event bus in the same account and Region](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-bus-to-bus.html)
	// - Firehose delivery stream
	// - Glue workflow
	// - [Incident Manager response plan](https://docs.aws.amazon.com//incident-manager/latest/userguide/incident-creation.html#incident-tracking-auto-eventbridge)
	// - Inspector assessment template
	// - Kinesis stream
	// - Lambda function
	// - Redshift cluster
	// - SageMaker Pipeline
	// - SNS topic
	// - SQS queue
	// - Step Functions state machine
	// - Systems Manager Automation
	// - Systems Manager OpsItem
	// - Systems Manager Run Command
	//
	// Creating rules with built-in targets is supported only in the AWS Management Console . The built-in targets are `EC2 CreateSnapshot API call` , `EC2 RebootInstances API call` , `EC2 StopInstances API call` , and `EC2 TerminateInstances API call` .
	//
	// For some target types, `PutTargets` provides target-specific parameters. If the target is a Kinesis data stream, you can optionally specify which shard the event goes to by using the `KinesisParameters` argument. To invoke a command on multiple EC2 instances with one rule, you can use the `RunCommandParameters` field.
	//
	// To be able to make API calls against the resources that you own, Amazon EventBridge needs the appropriate permissions. For AWS Lambda and Amazon SNS resources, EventBridge relies on resource-based policies. For EC2 instances, Kinesis Data Streams, AWS Step Functions state machines and API Gateway REST APIs, EventBridge relies on IAM roles that you specify in the `RoleARN` argument in `PutTargets` . For more information, see [Authentication and Access Control](https://docs.aws.amazon.com/eventbridge/latest/userguide/auth-and-access-control-eventbridge.html) in the *Amazon EventBridge User Guide* .
	//
	// If another AWS account is in the same region and has granted you permission (using `PutPermission` ), you can send events to that account. Set that account's event bus as a target of the rules in your account. To send the matched events to the other account, specify that account's event bus as the `Arn` value when you run `PutTargets` . If your account sends events to another account, your account is charged for each sent event. Each event sent to another account is charged as a custom event. The account receiving the event is not charged. For more information, see [Amazon EventBridge Pricing](https://docs.aws.amazon.com/eventbridge/pricing/) .
	//
	// > `Input` , `InputPath` , and `InputTransformer` are not available with `PutTarget` if the target is an event bus of a different AWS account.
	//
	// If you are setting the event bus of another account as the target, and that account granted permission to your account through an organization instead of directly by the account ID, then you must specify a `RoleArn` with proper permissions in the `Target` structure. For more information, see [Sending and Receiving Events Between AWS Accounts](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-cross-account-event-delivery.html) in the *Amazon EventBridge User Guide* .
	//
	// For more information about enabling cross-account events, see [PutPermission](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutPermission.html) .
	//
	// *Input* , *InputPath* , and *InputTransformer* are mutually exclusive and optional parameters of a target. When a rule is triggered due to a matched event:
	//
	// - If none of the following arguments are specified for a target, then the entire event is passed to the target in JSON format (unless the target is Amazon EC2 Run Command or Amazon ECS task, in which case nothing from the event is passed to the target).
	// - If *Input* is specified in the form of valid JSON, then the matched event is overridden with this constant.
	// - If *InputPath* is specified in the form of JSONPath (for example, `$.detail` ), then only the part of the event specified in the path is passed to the target (for example, only the detail part of the event is passed).
	// - If *InputTransformer* is specified, then one or more specified JSONPaths are extracted from the event and used as values in a template that you specify as the input to the target.
	//
	// When you specify `InputPath` or `InputTransformer` , you must use JSON dot notation, not bracket notation.
	//
	// When you add targets to a rule and the associated rule triggers soon after, new or updated targets might not be immediately invoked. Allow a short period of time for changes to take effect.
	//
	// This action can partially fail if too many requests are made at the same time. If that happens, `FailedEntryCount` is non-zero in the response and each entry in `FailedEntries` provides the ID of the failed target and the error code.
	Targets interface{} `field:"optional" json:"targets" yaml:"targets"`
}

Properties for defining a `CfnRule`.

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

cfnRuleProps := &cfnRuleProps{
	description: jsii.String("description"),
	eventBusName: jsii.String("eventBusName"),
	eventPattern: eventPattern,
	name: jsii.String("name"),
	roleArn: jsii.String("roleArn"),
	scheduleExpression: jsii.String("scheduleExpression"),
	state: jsii.String("state"),
	targets: []interface{}{
		&targetProperty{
			arn: jsii.String("arn"),
			id: jsii.String("id"),

			// the properties below are optional
			batchParameters: &batchParametersProperty{
				jobDefinition: jsii.String("jobDefinition"),
				jobName: jsii.String("jobName"),

				// the properties below are optional
				arrayProperties: &batchArrayPropertiesProperty{
					size: jsii.Number(123),
				},
				retryStrategy: &batchRetryStrategyProperty{
					attempts: jsii.Number(123),
				},
			},
			deadLetterConfig: &deadLetterConfigProperty{
				arn: jsii.String("arn"),
			},
			ecsParameters: &ecsParametersProperty{
				taskDefinitionArn: jsii.String("taskDefinitionArn"),

				// the properties below are optional
				capacityProviderStrategy: []interface{}{
					&capacityProviderStrategyItemProperty{
						capacityProvider: jsii.String("capacityProvider"),

						// the properties below are optional
						base: jsii.Number(123),
						weight: jsii.Number(123),
					},
				},
				enableEcsManagedTags: jsii.Boolean(false),
				enableExecuteCommand: jsii.Boolean(false),
				group: jsii.String("group"),
				launchType: jsii.String("launchType"),
				networkConfiguration: &networkConfigurationProperty{
					awsVpcConfiguration: &awsVpcConfigurationProperty{
						subnets: []*string{
							jsii.String("subnets"),
						},

						// the properties below are optional
						assignPublicIp: jsii.String("assignPublicIp"),
						securityGroups: []*string{
							jsii.String("securityGroups"),
						},
					},
				},
				placementConstraints: []interface{}{
					&placementConstraintProperty{
						expression: jsii.String("expression"),
						type: jsii.String("type"),
					},
				},
				placementStrategies: []interface{}{
					&placementStrategyProperty{
						field: jsii.String("field"),
						type: jsii.String("type"),
					},
				},
				platformVersion: jsii.String("platformVersion"),
				propagateTags: jsii.String("propagateTags"),
				referenceId: jsii.String("referenceId"),
				tagList: []interface{}{
					&cfnTag{
						key: jsii.String("key"),
						value: jsii.String("value"),
					},
				},
				taskCount: jsii.Number(123),
			},
			httpParameters: &httpParametersProperty{
				headerParameters: map[string]*string{
					"headerParametersKey": jsii.String("headerParameters"),
				},
				pathParameterValues: []*string{
					jsii.String("pathParameterValues"),
				},
				queryStringParameters: map[string]*string{
					"queryStringParametersKey": jsii.String("queryStringParameters"),
				},
			},
			input: jsii.String("input"),
			inputPath: jsii.String("inputPath"),
			inputTransformer: &inputTransformerProperty{
				inputTemplate: jsii.String("inputTemplate"),

				// the properties below are optional
				inputPathsMap: map[string]*string{
					"inputPathsMapKey": jsii.String("inputPathsMap"),
				},
			},
			kinesisParameters: &kinesisParametersProperty{
				partitionKeyPath: jsii.String("partitionKeyPath"),
			},
			redshiftDataParameters: &redshiftDataParametersProperty{
				database: jsii.String("database"),
				sql: jsii.String("sql"),

				// the properties below are optional
				dbUser: jsii.String("dbUser"),
				secretManagerArn: jsii.String("secretManagerArn"),
				statementName: jsii.String("statementName"),
				withEvent: jsii.Boolean(false),
			},
			retryPolicy: &retryPolicyProperty{
				maximumEventAgeInSeconds: jsii.Number(123),
				maximumRetryAttempts: jsii.Number(123),
			},
			roleArn: jsii.String("roleArn"),
			runCommandParameters: &runCommandParametersProperty{
				runCommandTargets: []interface{}{
					&runCommandTargetProperty{
						key: jsii.String("key"),
						values: []*string{
							jsii.String("values"),
						},
					},
				},
			},
			sageMakerPipelineParameters: &sageMakerPipelineParametersProperty{
				pipelineParameterList: []interface{}{
					&sageMakerPipelineParameterProperty{
						name: jsii.String("name"),
						value: jsii.String("value"),
					},
				},
			},
			sqsParameters: &sqsParametersProperty{
				messageGroupId: jsii.String("messageGroupId"),
			},
		},
	},
}

type CfnRule_AwsVpcConfigurationProperty

type CfnRule_AwsVpcConfigurationProperty struct {
	// Specifies the subnets associated with the task.
	//
	// These subnets must all be in the same VPC. You can specify as many as 16 subnets.
	Subnets *[]*string `field:"required" json:"subnets" yaml:"subnets"`
	// Specifies whether the task's elastic network interface receives a public IP address.
	//
	// You can specify `ENABLED` only when `LaunchType` in `EcsParameters` is set to `FARGATE` .
	AssignPublicIp *string `field:"optional" json:"assignPublicIp" yaml:"assignPublicIp"`
	// Specifies the security groups associated with the task.
	//
	// These security groups must all be in the same VPC. You can specify as many as five security groups. If you do not specify a security group, the default security group for the VPC is used.
	SecurityGroups *[]*string `field:"optional" json:"securityGroups" yaml:"securityGroups"`
}

This structure specifies the VPC subnets and security groups for the task, and whether a public IP address is to be used.

This structure is relevant only for ECS tasks that use the `awsvpc` network mode.

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"

awsVpcConfigurationProperty := &awsVpcConfigurationProperty{
	subnets: []*string{
		jsii.String("subnets"),
	},

	// the properties below are optional
	assignPublicIp: jsii.String("assignPublicIp"),
	securityGroups: []*string{
		jsii.String("securityGroups"),
	},
}

type CfnRule_BatchArrayPropertiesProperty

type CfnRule_BatchArrayPropertiesProperty struct {
	// The size of the array, if this is an array batch job.
	//
	// Valid values are integers between 2 and 10,000.
	Size *float64 `field:"optional" json:"size" yaml:"size"`
}

The array properties for the submitted job, such as the size of the array.

The array size can be between 2 and 10,000. If you specify array properties for a job, it becomes an array job. This parameter is used only if the target is an AWS Batch job.

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"

batchArrayPropertiesProperty := &batchArrayPropertiesProperty{
	size: jsii.Number(123),
}

type CfnRule_BatchParametersProperty

type CfnRule_BatchParametersProperty struct {
	// The ARN or name of the job definition to use if the event target is an AWS Batch job.
	//
	// This job definition must already exist.
	JobDefinition *string `field:"required" json:"jobDefinition" yaml:"jobDefinition"`
	// The name to use for this execution of the job, if the target is an AWS Batch job.
	JobName *string `field:"required" json:"jobName" yaml:"jobName"`
	// The array properties for the submitted job, such as the size of the array.
	//
	// The array size can be between 2 and 10,000. If you specify array properties for a job, it becomes an array job. This parameter is used only if the target is an AWS Batch job.
	ArrayProperties interface{} `field:"optional" json:"arrayProperties" yaml:"arrayProperties"`
	// The retry strategy to use for failed jobs, if the target is an AWS Batch job.
	//
	// The retry strategy is the number of times to retry the failed job execution. Valid values are 1–10. When you specify a retry strategy here, it overrides the retry strategy defined in the job definition.
	RetryStrategy interface{} `field:"optional" json:"retryStrategy" yaml:"retryStrategy"`
}

The custom parameters to be used when the target is an AWS Batch job.

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"

batchParametersProperty := &batchParametersProperty{
	jobDefinition: jsii.String("jobDefinition"),
	jobName: jsii.String("jobName"),

	// the properties below are optional
	arrayProperties: &batchArrayPropertiesProperty{
		size: jsii.Number(123),
	},
	retryStrategy: &batchRetryStrategyProperty{
		attempts: jsii.Number(123),
	},
}

type CfnRule_BatchRetryStrategyProperty

type CfnRule_BatchRetryStrategyProperty struct {
	// The number of times to attempt to retry, if the job fails.
	//
	// Valid values are 1–10.
	Attempts *float64 `field:"optional" json:"attempts" yaml:"attempts"`
}

The retry strategy to use for failed jobs, if the target is an AWS Batch job.

If you specify a retry strategy here, it overrides the retry strategy defined in the job definition.

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"

batchRetryStrategyProperty := &batchRetryStrategyProperty{
	attempts: jsii.Number(123),
}

type CfnRule_CapacityProviderStrategyItemProperty

type CfnRule_CapacityProviderStrategyItemProperty struct {
	// The short name of the capacity provider.
	CapacityProvider *string `field:"required" json:"capacityProvider" yaml:"capacityProvider"`
	// The base value designates how many tasks, at a minimum, to run on the specified capacity provider.
	//
	// Only one capacity provider in a capacity provider strategy can have a base defined. If no value is specified, the default value of 0 is used.
	Base *float64 `field:"optional" json:"base" yaml:"base"`
	// The weight value designates the relative percentage of the total number of tasks launched that should use the specified capacity provider.
	//
	// The weight value is taken into consideration after the base value, if defined, is satisfied.
	Weight *float64 `field:"optional" json:"weight" yaml:"weight"`
}

The details of a capacity provider strategy.

To learn more, see [CapacityProviderStrategyItem](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CapacityProviderStrategyItem.html) in the Amazon ECS API 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"

capacityProviderStrategyItemProperty := &capacityProviderStrategyItemProperty{
	capacityProvider: jsii.String("capacityProvider"),

	// the properties below are optional
	base: jsii.Number(123),
	weight: jsii.Number(123),
}

type CfnRule_DeadLetterConfigProperty

type CfnRule_DeadLetterConfigProperty struct {
	// The ARN of the SQS queue specified as the target for the dead-letter queue.
	Arn *string `field:"optional" json:"arn" yaml:"arn"`
}

A `DeadLetterConfig` object that contains information about a dead-letter queue 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"

deadLetterConfigProperty := &deadLetterConfigProperty{
	arn: jsii.String("arn"),
}

type CfnRule_EcsParametersProperty

type CfnRule_EcsParametersProperty struct {
	// The ARN of the task definition to use if the event target is an Amazon ECS task.
	TaskDefinitionArn *string `field:"required" json:"taskDefinitionArn" yaml:"taskDefinitionArn"`
	// The capacity provider strategy to use for the task.
	//
	// If a `capacityProviderStrategy` is specified, the `launchType` parameter must be omitted. If no `capacityProviderStrategy` or launchType is specified, the `defaultCapacityProviderStrategy` for the cluster is used.
	CapacityProviderStrategy interface{} `field:"optional" json:"capacityProviderStrategy" yaml:"capacityProviderStrategy"`
	// Specifies whether to enable Amazon ECS managed tags for the task.
	//
	// For more information, see [Tagging Your Amazon ECS Resources](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html) in the Amazon Elastic Container Service Developer Guide.
	EnableEcsManagedTags interface{} `field:"optional" json:"enableEcsManagedTags" yaml:"enableEcsManagedTags"`
	// Whether or not to enable the execute command functionality for the containers in this task.
	//
	// If true, this enables execute command functionality on all containers in the task.
	EnableExecuteCommand interface{} `field:"optional" json:"enableExecuteCommand" yaml:"enableExecuteCommand"`
	// Specifies an ECS task group for the task.
	//
	// The maximum length is 255 characters.
	Group *string `field:"optional" json:"group" yaml:"group"`
	// Specifies the launch type on which your task is running.
	//
	// The launch type that you specify here must match one of the launch type (compatibilities) of the target task. The `FARGATE` value is supported only in the Regions where AWS Fargate with Amazon ECS is supported. For more information, see [AWS Fargate on Amazon ECS](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS-Fargate.html) in the *Amazon Elastic Container Service Developer Guide* .
	LaunchType *string `field:"optional" json:"launchType" yaml:"launchType"`
	// Use this structure if the Amazon ECS task uses the `awsvpc` network mode.
	//
	// This structure specifies the VPC subnets and security groups associated with the task, and whether a public IP address is to be used. This structure is required if `LaunchType` is `FARGATE` because the `awsvpc` mode is required for Fargate tasks.
	//
	// If you specify `NetworkConfiguration` when the target ECS task does not use the `awsvpc` network mode, the task fails.
	NetworkConfiguration interface{} `field:"optional" json:"networkConfiguration" yaml:"networkConfiguration"`
	// An array of placement constraint objects to use for the task.
	//
	// You can specify up to 10 constraints per task (including constraints in the task definition and those specified at runtime).
	PlacementConstraints interface{} `field:"optional" json:"placementConstraints" yaml:"placementConstraints"`
	// The placement strategy objects to use for the task.
	//
	// You can specify a maximum of five strategy rules per task.
	PlacementStrategies interface{} `field:"optional" json:"placementStrategies" yaml:"placementStrategies"`
	// Specifies the platform version for the task.
	//
	// Specify only the numeric portion of the platform version, such as `1.1.0` .
	//
	// This structure is used only if `LaunchType` is `FARGATE` . For more information about valid platform versions, see [AWS Fargate Platform Versions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html) in the *Amazon Elastic Container Service Developer Guide* .
	PlatformVersion *string `field:"optional" json:"platformVersion" yaml:"platformVersion"`
	// Specifies whether to propagate the tags from the task definition to the task.
	//
	// If no value is specified, the tags are not propagated. Tags can only be propagated to the task during task creation. To add tags to a task after task creation, use the TagResource API action.
	PropagateTags *string `field:"optional" json:"propagateTags" yaml:"propagateTags"`
	// The reference ID to use for the task.
	ReferenceId *string `field:"optional" json:"referenceId" yaml:"referenceId"`
	// The metadata that you apply to the task to help you categorize and organize them.
	//
	// Each tag consists of a key and an optional value, both of which you define. To learn more, see [RunTask](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html#ECS-RunTask-request-tags) in the Amazon ECS API Reference.
	TagList interface{} `field:"optional" json:"tagList" yaml:"tagList"`
	// The number of tasks to create based on `TaskDefinition` .
	//
	// The default is 1.
	TaskCount *float64 `field:"optional" json:"taskCount" yaml:"taskCount"`
}

The custom parameters to be used when the target is an Amazon ECS task.

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"

ecsParametersProperty := &ecsParametersProperty{
	taskDefinitionArn: jsii.String("taskDefinitionArn"),

	// the properties below are optional
	capacityProviderStrategy: []interface{}{
		&capacityProviderStrategyItemProperty{
			capacityProvider: jsii.String("capacityProvider"),

			// the properties below are optional
			base: jsii.Number(123),
			weight: jsii.Number(123),
		},
	},
	enableEcsManagedTags: jsii.Boolean(false),
	enableExecuteCommand: jsii.Boolean(false),
	group: jsii.String("group"),
	launchType: jsii.String("launchType"),
	networkConfiguration: &networkConfigurationProperty{
		awsVpcConfiguration: &awsVpcConfigurationProperty{
			subnets: []*string{
				jsii.String("subnets"),
			},

			// the properties below are optional
			assignPublicIp: jsii.String("assignPublicIp"),
			securityGroups: []*string{
				jsii.String("securityGroups"),
			},
		},
	},
	placementConstraints: []interface{}{
		&placementConstraintProperty{
			expression: jsii.String("expression"),
			type: jsii.String("type"),
		},
	},
	placementStrategies: []interface{}{
		&placementStrategyProperty{
			field: jsii.String("field"),
			type: jsii.String("type"),
		},
	},
	platformVersion: jsii.String("platformVersion"),
	propagateTags: jsii.String("propagateTags"),
	referenceId: jsii.String("referenceId"),
	tagList: []interface{}{
		&cfnTag{
			key: jsii.String("key"),
			value: jsii.String("value"),
		},
	},
	taskCount: jsii.Number(123),
}

type CfnRule_HttpParametersProperty

type CfnRule_HttpParametersProperty struct {
	// The headers that need to be sent as part of request invoking the API Gateway REST API or EventBridge ApiDestination.
	HeaderParameters interface{} `field:"optional" json:"headerParameters" yaml:"headerParameters"`
	// The path parameter values to be used to populate API Gateway REST API or EventBridge ApiDestination path wildcards ("*").
	PathParameterValues *[]*string `field:"optional" json:"pathParameterValues" yaml:"pathParameterValues"`
	// The query string keys/values that need to be sent as part of request invoking the API Gateway REST API or EventBridge ApiDestination.
	QueryStringParameters interface{} `field:"optional" json:"queryStringParameters" yaml:"queryStringParameters"`
}

These are custom parameter to be used when the target is an API Gateway REST APIs or EventBridge ApiDestinations.

In the latter case, these are merged with any InvocationParameters specified on the Connection, with any values from the Connection taking precedence.

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"

httpParametersProperty := &httpParametersProperty{
	headerParameters: map[string]*string{
		"headerParametersKey": jsii.String("headerParameters"),
	},
	pathParameterValues: []*string{
		jsii.String("pathParameterValues"),
	},
	queryStringParameters: map[string]*string{
		"queryStringParametersKey": jsii.String("queryStringParameters"),
	},
}

type CfnRule_InputTransformerProperty

type CfnRule_InputTransformerProperty struct {
	// Input template where you specify placeholders that will be filled with the values of the keys from `InputPathsMap` to customize the data sent to the target.
	//
	// Enclose each `InputPathsMaps` value in brackets: < *value* > The InputTemplate must be valid JSON.
	//
	// If `InputTemplate` is a JSON object (surrounded by curly braces), the following restrictions apply:
	//
	// - The placeholder cannot be used as an object key.
	//
	// The following example shows the syntax for using `InputPathsMap` and `InputTemplate` .
	//
	// `"InputTransformer":`
	//
	// `{`
	//
	// `"InputPathsMap": {"instance": "$.detail.instance","status": "$.detail.status"},`
	//
	// `"InputTemplate": "<instance> is in state <status>"`
	//
	// `}`
	//
	// To have the `InputTemplate` include quote marks within a JSON string, escape each quote marks with a slash, as in the following example:
	//
	// `"InputTransformer":`
	//
	// `{`
	//
	// `"InputPathsMap": {"instance": "$.detail.instance","status": "$.detail.status"},`
	//
	// `"InputTemplate": "<instance> is in state \"<status>\""`
	//
	// `}`
	//
	// The `InputTemplate` can also be valid JSON with varibles in quotes or out, as in the following example:
	//
	// `"InputTransformer":`
	//
	// `{`
	//
	// `"InputPathsMap": {"instance": "$.detail.instance","status": "$.detail.status"},`
	//
	// `"InputTemplate": '{"myInstance": <instance>,"myStatus": "<instance> is in state \"<status>\""}'`
	//
	// `}`.
	InputTemplate *string `field:"required" json:"inputTemplate" yaml:"inputTemplate"`
	// Map of JSON paths to be extracted from the event.
	//
	// You can then insert these in the template in `InputTemplate` to produce the output you want to be sent to the target.
	//
	// `InputPathsMap` is an array key-value pairs, where each value is a valid JSON path. You can have as many as 100 key-value pairs. You must use JSON dot notation, not bracket notation.
	//
	// The keys cannot start with " AWS ."
	InputPathsMap interface{} `field:"optional" json:"inputPathsMap" yaml:"inputPathsMap"`
}

Contains the parameters needed for you to provide custom input to a target based on one or more pieces of data extracted from the event.

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"

inputTransformerProperty := &inputTransformerProperty{
	inputTemplate: jsii.String("inputTemplate"),

	// the properties below are optional
	inputPathsMap: map[string]*string{
		"inputPathsMapKey": jsii.String("inputPathsMap"),
	},
}

type CfnRule_KinesisParametersProperty

type CfnRule_KinesisParametersProperty struct {
	// The JSON path to be extracted from the event and used as the partition key.
	//
	// For more information, see [Amazon Kinesis Streams Key Concepts](https://docs.aws.amazon.com/streams/latest/dev/key-concepts.html#partition-key) in the *Amazon Kinesis Streams Developer Guide* .
	PartitionKeyPath *string `field:"required" json:"partitionKeyPath" yaml:"partitionKeyPath"`
}

This object enables you to specify a JSON path to extract from the event and use as the partition key for the Amazon Kinesis data stream, so that you can control the shard to which the event goes.

If you do not include this parameter, the default is to use the `eventId` as the partition key.

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"

kinesisParametersProperty := &kinesisParametersProperty{
	partitionKeyPath: jsii.String("partitionKeyPath"),
}

type CfnRule_NetworkConfigurationProperty

type CfnRule_NetworkConfigurationProperty struct {
	// Use this structure to specify the VPC subnets and security groups for the task, and whether a public IP address is to be used.
	//
	// This structure is relevant only for ECS tasks that use the `awsvpc` network mode.
	AwsVpcConfiguration interface{} `field:"optional" json:"awsVpcConfiguration" yaml:"awsVpcConfiguration"`
}

This structure specifies the network configuration for an ECS task.

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"

networkConfigurationProperty := &networkConfigurationProperty{
	awsVpcConfiguration: &awsVpcConfigurationProperty{
		subnets: []*string{
			jsii.String("subnets"),
		},

		// the properties below are optional
		assignPublicIp: jsii.String("assignPublicIp"),
		securityGroups: []*string{
			jsii.String("securityGroups"),
		},
	},
}

type CfnRule_PlacementConstraintProperty

type CfnRule_PlacementConstraintProperty struct {
	// A cluster query language expression to apply to the constraint.
	//
	// You cannot specify an expression if the constraint type is `distinctInstance` . To learn more, see [Cluster Query Language](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html) in the Amazon Elastic Container Service Developer Guide.
	Expression *string `field:"optional" json:"expression" yaml:"expression"`
	// The type of constraint.
	//
	// Use distinctInstance to ensure that each task in a particular group is running on a different container instance. Use memberOf to restrict the selection to a group of valid candidates.
	Type *string `field:"optional" json:"type" yaml:"type"`
}

An object representing a constraint on task placement.

To learn more, see [Task Placement Constraints](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html) in the Amazon Elastic Container Service Developer 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"

placementConstraintProperty := &placementConstraintProperty{
	expression: jsii.String("expression"),
	type: jsii.String("type"),
}

type CfnRule_PlacementStrategyProperty

type CfnRule_PlacementStrategyProperty struct {
	// The field to apply the placement strategy against.
	//
	// For the spread placement strategy, valid values are instanceId (or host, which has the same effect), or any platform or custom attribute that is applied to a container instance, such as attribute:ecs.availability-zone. For the binpack placement strategy, valid values are cpu and memory. For the random placement strategy, this field is not used.
	Field *string `field:"optional" json:"field" yaml:"field"`
	// The type of placement strategy.
	//
	// The random placement strategy randomly places tasks on available candidates. The spread placement strategy spreads placement across available candidates evenly based on the field parameter. The binpack strategy places tasks on available candidates that have the least available amount of the resource that is specified with the field parameter. For example, if you binpack on memory, a task is placed on the instance with the least amount of remaining memory (but still enough to run the task).
	Type *string `field:"optional" json:"type" yaml:"type"`
}

The task placement strategy for a task or service.

To learn more, see [Task Placement Strategies](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-strategies.html) in the Amazon Elastic Container Service Service Developer 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"

placementStrategyProperty := &placementStrategyProperty{
	field: jsii.String("field"),
	type: jsii.String("type"),
}

type CfnRule_RedshiftDataParametersProperty

type CfnRule_RedshiftDataParametersProperty struct {
	// The name of the database.
	//
	// Required when authenticating using temporary credentials.
	Database *string `field:"required" json:"database" yaml:"database"`
	// The SQL statement text to run.
	Sql *string `field:"required" json:"sql" yaml:"sql"`
	// The database user name.
	//
	// Required when authenticating using temporary credentials.
	DbUser *string `field:"optional" json:"dbUser" yaml:"dbUser"`
	// The name or ARN of the secret that enables access to the database.
	//
	// Required when authenticating using AWS Secrets Manager.
	SecretManagerArn *string `field:"optional" json:"secretManagerArn" yaml:"secretManagerArn"`
	// The name of the SQL statement.
	//
	// You can name the SQL statement when you create it to identify the query.
	StatementName *string `field:"optional" json:"statementName" yaml:"statementName"`
	// Indicates whether to send an event back to EventBridge after the SQL statement runs.
	WithEvent interface{} `field:"optional" json:"withEvent" yaml:"withEvent"`
}

These are custom parameters to be used when the target is a Amazon Redshift cluster to invoke the Amazon Redshift Data API ExecuteStatement based on EventBridge events.

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"

redshiftDataParametersProperty := &redshiftDataParametersProperty{
	database: jsii.String("database"),
	sql: jsii.String("sql"),

	// the properties below are optional
	dbUser: jsii.String("dbUser"),
	secretManagerArn: jsii.String("secretManagerArn"),
	statementName: jsii.String("statementName"),
	withEvent: jsii.Boolean(false),
}

type CfnRule_RetryPolicyProperty

type CfnRule_RetryPolicyProperty struct {
	// The maximum amount of time, in seconds, to continue to make retry attempts.
	MaximumEventAgeInSeconds *float64 `field:"optional" json:"maximumEventAgeInSeconds" yaml:"maximumEventAgeInSeconds"`
	// The maximum number of retry attempts to make before the request fails.
	//
	// Retry attempts continue until either the maximum number of attempts is made or until the duration of the `MaximumEventAgeInSeconds` is met.
	MaximumRetryAttempts *float64 `field:"optional" json:"maximumRetryAttempts" yaml:"maximumRetryAttempts"`
}

A `RetryPolicy` object that includes information about the retry policy settings.

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"

retryPolicyProperty := &retryPolicyProperty{
	maximumEventAgeInSeconds: jsii.Number(123),
	maximumRetryAttempts: jsii.Number(123),
}

type CfnRule_RunCommandParametersProperty

type CfnRule_RunCommandParametersProperty struct {
	// Currently, we support including only one RunCommandTarget block, which specifies either an array of InstanceIds or a tag.
	RunCommandTargets interface{} `field:"required" json:"runCommandTargets" yaml:"runCommandTargets"`
}

This parameter contains the criteria (either InstanceIds or a tag) used to specify which EC2 instances are to be sent the command.

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"

runCommandParametersProperty := &runCommandParametersProperty{
	runCommandTargets: []interface{}{
		&runCommandTargetProperty{
			key: jsii.String("key"),
			values: []*string{
				jsii.String("values"),
			},
		},
	},
}

type CfnRule_RunCommandTargetProperty

type CfnRule_RunCommandTargetProperty struct {
	// Can be either `tag:` *tag-key* or `InstanceIds` .
	Key *string `field:"required" json:"key" yaml:"key"`
	// If `Key` is `tag:` *tag-key* , `Values` is a list of tag values.
	//
	// If `Key` is `InstanceIds` , `Values` is a list of Amazon EC2 instance IDs.
	Values *[]*string `field:"required" json:"values" yaml:"values"`
}

Information about the EC2 instances that are to be sent the command, specified as key-value pairs.

Each `RunCommandTarget` block can include only one key, but this key may specify multiple values.

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"

runCommandTargetProperty := &runCommandTargetProperty{
	key: jsii.String("key"),
	values: []*string{
		jsii.String("values"),
	},
}

type CfnRule_SageMakerPipelineParameterProperty added in v2.11.0

type CfnRule_SageMakerPipelineParameterProperty struct {
	// Name of parameter to start execution of a SageMaker Model Building Pipeline.
	Name *string `field:"required" json:"name" yaml:"name"`
	// Value of parameter to start execution of a SageMaker Model Building Pipeline.
	Value *string `field:"required" json:"value" yaml:"value"`
}

Name/Value pair of a parameter to start execution of a SageMaker Model Building Pipeline.

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"

sageMakerPipelineParameterProperty := &sageMakerPipelineParameterProperty{
	name: jsii.String("name"),
	value: jsii.String("value"),
}

type CfnRule_SageMakerPipelineParametersProperty added in v2.11.0

type CfnRule_SageMakerPipelineParametersProperty struct {
	// List of Parameter names and values for SageMaker Model Building Pipeline execution.
	PipelineParameterList interface{} `field:"optional" json:"pipelineParameterList" yaml:"pipelineParameterList"`
}

These are custom parameters to use when the target is a SageMaker Model Building Pipeline that starts based on EventBridge events.

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"

sageMakerPipelineParametersProperty := &sageMakerPipelineParametersProperty{
	pipelineParameterList: []interface{}{
		&sageMakerPipelineParameterProperty{
			name: jsii.String("name"),
			value: jsii.String("value"),
		},
	},
}

type CfnRule_SqsParametersProperty

type CfnRule_SqsParametersProperty struct {
	// The FIFO message group ID to use as the target.
	MessageGroupId *string `field:"required" json:"messageGroupId" yaml:"messageGroupId"`
}

This structure includes the custom parameter to be used when the target is an SQS FIFO queue.

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"

sqsParametersProperty := &sqsParametersProperty{
	messageGroupId: jsii.String("messageGroupId"),
}

type CfnRule_TagProperty

type CfnRule_TagProperty struct {
	// A string you can use to assign a value.
	//
	// The combination of tag keys and values can help you organize and categorize your resources.
	Key *string `field:"optional" json:"key" yaml:"key"`
	// The value for the specified tag key.
	Value *string `field:"optional" json:"value" yaml:"value"`
}

A key-value pair associated with an ECS Target of an EventBridge rule.

The tag will be propagated to ECS by EventBridge when starting an ECS task based on a matched event.

> Currently, tags are only available when using ECS with EventBridge .

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"

tagProperty := &tagProperty{
	key: jsii.String("key"),
	value: jsii.String("value"),
}

type CfnRule_TargetProperty

type CfnRule_TargetProperty struct {
	// The Amazon Resource Name (ARN) of the target.
	Arn *string `field:"required" json:"arn" yaml:"arn"`
	// The ID of the target within the specified rule.
	//
	// Use this ID to reference the target when updating the rule. We recommend using a memorable and unique string.
	Id *string `field:"required" json:"id" yaml:"id"`
	// If the event target is an AWS Batch job, this contains the job definition, job name, and other parameters.
	//
	// For more information, see [Jobs](https://docs.aws.amazon.com/batch/latest/userguide/jobs.html) in the *AWS Batch User Guide* .
	BatchParameters interface{} `field:"optional" json:"batchParameters" yaml:"batchParameters"`
	// The `DeadLetterConfig` that defines the target queue to send dead-letter queue events to.
	DeadLetterConfig interface{} `field:"optional" json:"deadLetterConfig" yaml:"deadLetterConfig"`
	// Contains the Amazon ECS task definition and task count to be used, if the event target is an Amazon ECS task.
	//
	// For more information about Amazon ECS tasks, see [Task Definitions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_defintions.html) in the *Amazon EC2 Container Service Developer Guide* .
	EcsParameters interface{} `field:"optional" json:"ecsParameters" yaml:"ecsParameters"`
	// Contains the HTTP parameters to use when the target is a API Gateway REST endpoint or EventBridge ApiDestination.
	//
	// If you specify an API Gateway REST API or EventBridge ApiDestination as a target, you can use this parameter to specify headers, path parameters, and query string keys/values as part of your target invoking request. If you're using ApiDestinations, the corresponding Connection can also have these values configured. In case of any conflicting keys, values from the Connection take precedence.
	HttpParameters interface{} `field:"optional" json:"httpParameters" yaml:"httpParameters"`
	// Valid JSON text passed to the target.
	//
	// In this case, nothing from the event itself is passed to the target. For more information, see [The JavaScript Object Notation (JSON) Data Interchange Format](https://docs.aws.amazon.com/http://www.rfc-editor.org/rfc/rfc7159.txt) .
	Input *string `field:"optional" json:"input" yaml:"input"`
	// The value of the JSONPath that is used for extracting part of the matched event when passing it to the target.
	//
	// You must use JSON dot notation, not bracket notation. For more information about JSON paths, see [JSONPath](https://docs.aws.amazon.com/http://goessner.net/articles/JsonPath/) .
	InputPath *string `field:"optional" json:"inputPath" yaml:"inputPath"`
	// Settings to enable you to provide custom input to a target based on certain event data.
	//
	// You can extract one or more key-value pairs from the event and then use that data to send customized input to the target.
	InputTransformer interface{} `field:"optional" json:"inputTransformer" yaml:"inputTransformer"`
	// The custom parameter you can use to control the shard assignment, when the target is a Kinesis data stream.
	//
	// If you do not include this parameter, the default is to use the `eventId` as the partition key.
	KinesisParameters interface{} `field:"optional" json:"kinesisParameters" yaml:"kinesisParameters"`
	// Contains the Amazon Redshift Data API parameters to use when the target is a Amazon Redshift cluster.
	//
	// If you specify a Amazon Redshift Cluster as a Target, you can use this to specify parameters to invoke the Amazon Redshift Data API ExecuteStatement based on EventBridge events.
	RedshiftDataParameters interface{} `field:"optional" json:"redshiftDataParameters" yaml:"redshiftDataParameters"`
	// The `RetryPolicy` object that contains the retry policy configuration to use for the dead-letter queue.
	RetryPolicy interface{} `field:"optional" json:"retryPolicy" yaml:"retryPolicy"`
	// The Amazon Resource Name (ARN) of the IAM role to be used for this target when the rule is triggered.
	//
	// If one rule triggers multiple targets, you can use a different IAM role for each target.
	RoleArn *string `field:"optional" json:"roleArn" yaml:"roleArn"`
	// Parameters used when you are using the rule to invoke Amazon EC2 Run Command.
	RunCommandParameters interface{} `field:"optional" json:"runCommandParameters" yaml:"runCommandParameters"`
	// Contains the SageMaker Model Building Pipeline parameters to start execution of a SageMaker Model Building Pipeline.
	//
	// If you specify a SageMaker Model Building Pipeline as a target, you can use this to specify parameters to start a pipeline execution based on EventBridge events.
	SageMakerPipelineParameters interface{} `field:"optional" json:"sageMakerPipelineParameters" yaml:"sageMakerPipelineParameters"`
	// Contains the message group ID to use when the target is a FIFO queue.
	//
	// If you specify an SQS FIFO queue as a target, the queue must have content-based deduplication enabled.
	SqsParameters interface{} `field:"optional" json:"sqsParameters" yaml:"sqsParameters"`
}

Targets are the resources to be invoked when a rule is triggered.

For a complete list of services and resources that can be set as a target, see [PutTargets](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutTargets.html) .

If you are setting the event bus of another account as the target, and that account granted permission to your account through an organization instead of directly by the account ID, then you must specify a `RoleArn` with proper permissions in the `Target` structure. For more information, see [Sending and Receiving Events Between AWS Accounts](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-cross-account-event-delivery.html) in the *Amazon EventBridge 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"

targetProperty := &targetProperty{
	arn: jsii.String("arn"),
	id: jsii.String("id"),

	// the properties below are optional
	batchParameters: &batchParametersProperty{
		jobDefinition: jsii.String("jobDefinition"),
		jobName: jsii.String("jobName"),

		// the properties below are optional
		arrayProperties: &batchArrayPropertiesProperty{
			size: jsii.Number(123),
		},
		retryStrategy: &batchRetryStrategyProperty{
			attempts: jsii.Number(123),
		},
	},
	deadLetterConfig: &deadLetterConfigProperty{
		arn: jsii.String("arn"),
	},
	ecsParameters: &ecsParametersProperty{
		taskDefinitionArn: jsii.String("taskDefinitionArn"),

		// the properties below are optional
		capacityProviderStrategy: []interface{}{
			&capacityProviderStrategyItemProperty{
				capacityProvider: jsii.String("capacityProvider"),

				// the properties below are optional
				base: jsii.Number(123),
				weight: jsii.Number(123),
			},
		},
		enableEcsManagedTags: jsii.Boolean(false),
		enableExecuteCommand: jsii.Boolean(false),
		group: jsii.String("group"),
		launchType: jsii.String("launchType"),
		networkConfiguration: &networkConfigurationProperty{
			awsVpcConfiguration: &awsVpcConfigurationProperty{
				subnets: []*string{
					jsii.String("subnets"),
				},

				// the properties below are optional
				assignPublicIp: jsii.String("assignPublicIp"),
				securityGroups: []*string{
					jsii.String("securityGroups"),
				},
			},
		},
		placementConstraints: []interface{}{
			&placementConstraintProperty{
				expression: jsii.String("expression"),
				type: jsii.String("type"),
			},
		},
		placementStrategies: []interface{}{
			&placementStrategyProperty{
				field: jsii.String("field"),
				type: jsii.String("type"),
			},
		},
		platformVersion: jsii.String("platformVersion"),
		propagateTags: jsii.String("propagateTags"),
		referenceId: jsii.String("referenceId"),
		tagList: []interface{}{
			&cfnTag{
				key: jsii.String("key"),
				value: jsii.String("value"),
			},
		},
		taskCount: jsii.Number(123),
	},
	httpParameters: &httpParametersProperty{
		headerParameters: map[string]*string{
			"headerParametersKey": jsii.String("headerParameters"),
		},
		pathParameterValues: []*string{
			jsii.String("pathParameterValues"),
		},
		queryStringParameters: map[string]*string{
			"queryStringParametersKey": jsii.String("queryStringParameters"),
		},
	},
	input: jsii.String("input"),
	inputPath: jsii.String("inputPath"),
	inputTransformer: &inputTransformerProperty{
		inputTemplate: jsii.String("inputTemplate"),

		// the properties below are optional
		inputPathsMap: map[string]*string{
			"inputPathsMapKey": jsii.String("inputPathsMap"),
		},
	},
	kinesisParameters: &kinesisParametersProperty{
		partitionKeyPath: jsii.String("partitionKeyPath"),
	},
	redshiftDataParameters: &redshiftDataParametersProperty{
		database: jsii.String("database"),
		sql: jsii.String("sql"),

		// the properties below are optional
		dbUser: jsii.String("dbUser"),
		secretManagerArn: jsii.String("secretManagerArn"),
		statementName: jsii.String("statementName"),
		withEvent: jsii.Boolean(false),
	},
	retryPolicy: &retryPolicyProperty{
		maximumEventAgeInSeconds: jsii.Number(123),
		maximumRetryAttempts: jsii.Number(123),
	},
	roleArn: jsii.String("roleArn"),
	runCommandParameters: &runCommandParametersProperty{
		runCommandTargets: []interface{}{
			&runCommandTargetProperty{
				key: jsii.String("key"),
				values: []*string{
					jsii.String("values"),
				},
			},
		},
	},
	sageMakerPipelineParameters: &sageMakerPipelineParametersProperty{
		pipelineParameterList: []interface{}{
			&sageMakerPipelineParameterProperty{
				name: jsii.String("name"),
				value: jsii.String("value"),
			},
		},
	},
	sqsParameters: &sqsParametersProperty{
		messageGroupId: jsii.String("messageGroupId"),
	},
}

type Connection added in v2.13.0

type Connection interface {
	awscdk.Resource
	IConnection
	// The ARN of the connection created.
	ConnectionArn() *string
	// The Name for the connection.
	ConnectionName() *string
	// The ARN for the secret created for the connection.
	ConnectionSecretArn() *string
	// 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
}

Define an EventBridge Connection.

Example:

connection := events.NewConnection(this, jsii.String("Connection"), &connectionProps{
	authorization: events.authorization.apiKey(jsii.String("x-api-key"), awscdk.SecretValue.secretsManager(jsii.String("ApiSecretName"))),
	description: jsii.String("Connection with API Key x-api-key"),
})

destination := events.NewApiDestination(this, jsii.String("Destination"), &apiDestinationProps{
	connection: connection,
	endpoint: jsii.String("https://example.com"),
	description: jsii.String("Calling example.com with API key x-api-key"),
})

rule := events.NewRule(this, jsii.String("Rule"), &ruleProps{
	schedule: events.schedule.rate(cdk.duration.minutes(jsii.Number(1))),
	targets: []iRuleTarget{
		targets.NewApiDestination(destination),
	},
})

func NewConnection added in v2.13.0

func NewConnection(scope constructs.Construct, id *string, props *ConnectionProps) Connection

type ConnectionAttributes added in v2.13.0

type ConnectionAttributes struct {
	// The ARN of the connection created.
	ConnectionArn *string `field:"required" json:"connectionArn" yaml:"connectionArn"`
	// The Name for the connection.
	ConnectionName *string `field:"required" json:"connectionName" yaml:"connectionName"`
	// The ARN for the secret created for the connection.
	ConnectionSecretArn *string `field:"required" json:"connectionSecretArn" yaml:"connectionSecretArn"`
}

Interface with properties necessary to import a reusable Connection.

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"

connectionAttributes := &connectionAttributes{
	connectionArn: jsii.String("connectionArn"),
	connectionName: jsii.String("connectionName"),
	connectionSecretArn: jsii.String("connectionSecretArn"),
}

type ConnectionProps added in v2.13.0

type ConnectionProps struct {
	// The authorization type for the connection.
	Authorization Authorization `field:"required" json:"authorization" yaml:"authorization"`
	// Additional string parameters to add to the invocation bodies.
	BodyParameters *map[string]HttpParameter `field:"optional" json:"bodyParameters" yaml:"bodyParameters"`
	// The name of the connection.
	ConnectionName *string `field:"optional" json:"connectionName" yaml:"connectionName"`
	// The name of the connection.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// Additional string parameters to add to the invocation headers.
	HeaderParameters *map[string]HttpParameter `field:"optional" json:"headerParameters" yaml:"headerParameters"`
	// Additional string parameters to add to the invocation query strings.
	QueryStringParameters *map[string]HttpParameter `field:"optional" json:"queryStringParameters" yaml:"queryStringParameters"`
}

An API Destination Connection.

A connection defines the authorization type and credentials to use for authorization with an API destination HTTP endpoint.

Example:

connection := events.NewConnection(this, jsii.String("Connection"), &connectionProps{
	authorization: events.authorization.apiKey(jsii.String("x-api-key"), awscdk.SecretValue.secretsManager(jsii.String("ApiSecretName"))),
	description: jsii.String("Connection with API Key x-api-key"),
})

destination := events.NewApiDestination(this, jsii.String("Destination"), &apiDestinationProps{
	connection: connection,
	endpoint: jsii.String("https://example.com"),
	description: jsii.String("Calling example.com with API key x-api-key"),
})

rule := events.NewRule(this, jsii.String("Rule"), &ruleProps{
	schedule: events.schedule.rate(cdk.duration.minutes(jsii.Number(1))),
	targets: []iRuleTarget{
		targets.NewApiDestination(destination),
	},
})

type CronOptions

type CronOptions struct {
	// The day of the month to run this rule at.
	Day *string `field:"optional" json:"day" yaml:"day"`
	// The hour to run this rule at.
	Hour *string `field:"optional" json:"hour" yaml:"hour"`
	// The minute to run this rule at.
	Minute *string `field:"optional" json:"minute" yaml:"minute"`
	// The month to run this rule at.
	Month *string `field:"optional" json:"month" yaml:"month"`
	// The day of the week to run this rule at.
	WeekDay *string `field:"optional" json:"weekDay" yaml:"weekDay"`
	// The year to run this rule at.
	Year *string `field:"optional" json:"year" yaml:"year"`
}

Options to configure a cron expression.

All fields are strings so you can use complex expressions. Absence of a field implies '*' or '?', whichever one is appropriate.

Example:

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

var fn function

rule := events.NewRule(this, jsii.String("Schedule Rule"), &ruleProps{
	schedule: events.schedule.cron(&cronOptions{
		minute: jsii.String("0"),
		hour: jsii.String("4"),
	}),
})
rule.addTarget(targets.NewLambdaFunction(fn))

See: https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions

type EventBus

type EventBus interface {
	awscdk.Resource
	IEventBus
	// 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 ARN of the event bus, such as: arn:aws:events:us-east-2:123456789012:event-bus/aws.partner/PartnerName/acct1/repo1.
	EventBusArn() *string
	// The physical ID of this event bus resource.
	EventBusName() *string
	// The policy for the event bus in JSON form.
	EventBusPolicy() *string
	// The name of the partner event source.
	EventSourceName() *string
	// 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
	// Adds a statement to the IAM resource policy associated with this event bus.
	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)
	// Create an EventBridge archive to send events to.
	//
	// When you create an archive, incoming events might not immediately start being sent to the archive.
	// Allow a short period of time for changes to take effect.
	Archive(id *string, props *BaseArchiveProps) Archive
	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
	// Grants an IAM Principal to send custom events to the eventBus so that they can be matched to rules.
	GrantPutEventsTo(grantee awsiam.IGrantable) awsiam.Grant
	// Returns a string representation of this construct.
	ToString() *string
}

Define an EventBridge EventBus.

Example:

bus := events.NewEventBus(this, jsii.String("bus"), &eventBusProps{
	eventBusName: jsii.String("MyCustomEventBus"),
})

bus.archive(jsii.String("MyArchive"), &baseArchiveProps{
	archiveName: jsii.String("MyCustomEventBusArchive"),
	description: jsii.String("MyCustomerEventBus Archive"),
	eventPattern: &eventPattern{
		account: []*string{
			awscdk.*stack.of(this).account,
		},
	},
	retention: awscdk.Duration.days(jsii.Number(365)),
})

func NewEventBus

func NewEventBus(scope constructs.Construct, id *string, props *EventBusProps) EventBus

type EventBusAttributes

type EventBusAttributes struct {
	// The ARN of this event bus resource.
	EventBusArn *string `field:"required" json:"eventBusArn" yaml:"eventBusArn"`
	// The physical ID of this event bus resource.
	EventBusName *string `field:"required" json:"eventBusName" yaml:"eventBusName"`
	// The JSON policy of this event bus resource.
	EventBusPolicy *string `field:"required" json:"eventBusPolicy" yaml:"eventBusPolicy"`
	// The partner event source to associate with this event bus resource.
	EventSourceName *string `field:"optional" json:"eventSourceName" yaml:"eventSourceName"`
}

Interface with properties necessary to import a reusable EventBus.

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"

eventBusAttributes := &eventBusAttributes{
	eventBusArn: jsii.String("eventBusArn"),
	eventBusName: jsii.String("eventBusName"),
	eventBusPolicy: jsii.String("eventBusPolicy"),

	// the properties below are optional
	eventSourceName: jsii.String("eventSourceName"),
}

type EventBusPolicy added in v2.54.0

type EventBusPolicy interface {
	awscdk.Resource
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	Env() *awscdk.ResourceEnvironment
	// The tree node.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//    cross-environment scenarios.
	PhysicalName() *string
	// The stack in which this resource is defined.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	GetResourceNameAttribute(nameAttr *string) *string
	// Returns a string representation of this construct.
	ToString() *string
}

The policy for an Event Bus.

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:

// 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 eventBus eventBus
var policyStatement policyStatement

eventBusPolicy := awscdk.Aws_events.NewEventBusPolicy(this, jsii.String("MyEventBusPolicy"), &eventBusPolicyProps{
	eventBus: eventBus,
	statement: policyStatement,
	statementId: jsii.String("statementId"),
})

func NewEventBusPolicy added in v2.54.0

func NewEventBusPolicy(scope constructs.Construct, id *string, props *EventBusPolicyProps) EventBusPolicy

type EventBusPolicyProps added in v2.54.0

type EventBusPolicyProps struct {
	// The event bus to which the policy applies.
	EventBus IEventBus `field:"required" json:"eventBus" yaml:"eventBus"`
	// An IAM Policy Statement to apply to the Event Bus.
	Statement awsiam.PolicyStatement `field:"required" json:"statement" yaml:"statement"`
	// An identifier string for the external account that you are granting permissions to.
	StatementId *string `field:"required" json:"statementId" yaml:"statementId"`
}

Properties to associate Event Buses with a 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"
import "github.com/aws/aws-cdk-go/awscdk"

var eventBus eventBus
var policyStatement policyStatement

eventBusPolicyProps := &eventBusPolicyProps{
	eventBus: eventBus,
	statement: policyStatement,
	statementId: jsii.String("statementId"),
}

type EventBusProps

type EventBusProps struct {
	// The name of the event bus you are creating Note: If 'eventSourceName' is passed in, you cannot set this.
	EventBusName *string `field:"optional" json:"eventBusName" yaml:"eventBusName"`
	// The partner event source to associate with this event bus resource Note: If 'eventBusName' is passed in, you cannot set this.
	EventSourceName *string `field:"optional" json:"eventSourceName" yaml:"eventSourceName"`
}

Properties to define an event bus.

Example:

bus := events.NewEventBus(this, jsii.String("bus"), &eventBusProps{
	eventBusName: jsii.String("MyCustomEventBus"),
})

bus.archive(jsii.String("MyArchive"), &baseArchiveProps{
	archiveName: jsii.String("MyCustomEventBusArchive"),
	description: jsii.String("MyCustomerEventBus Archive"),
	eventPattern: &eventPattern{
		account: []*string{
			awscdk.*stack.of(this).account,
		},
	},
	retention: awscdk.Duration.days(jsii.Number(365)),
})

type EventCommonOptions added in v2.38.0

type EventCommonOptions struct {
	// The scope to use if the source of the rule and its target are in different Stacks (but in the same account & region).
	//
	// This helps dealing with cycles that often arise in these situations.
	CrossStackScope constructs.Construct `field:"optional" json:"crossStackScope" yaml:"crossStackScope"`
	// A description of the rule's purpose.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// Additional restrictions for the event to route to the specified target.
	//
	// The method that generates the rule probably imposes some type of event
	// filtering. The filtering implied by what you pass here is added
	// on top of that filtering.
	// See: https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html
	//
	EventPattern *EventPattern `field:"optional" json:"eventPattern" yaml:"eventPattern"`
	// A name for the rule.
	RuleName *string `field:"optional" json:"ruleName" yaml:"ruleName"`
}

Common options for Events.

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 constructs "github.com/aws/constructs-go/constructs"

var construct construct
var detail interface{}

eventCommonOptions := &eventCommonOptions{
	crossStackScope: construct,
	description: jsii.String("description"),
	eventPattern: &eventPattern{
		account: []*string{
			jsii.String("account"),
		},
		detail: map[string]interface{}{
			"detailKey": detail,
		},
		detailType: []*string{
			jsii.String("detailType"),
		},
		id: []*string{
			jsii.String("id"),
		},
		region: []*string{
			jsii.String("region"),
		},
		resources: []*string{
			jsii.String("resources"),
		},
		source: []*string{
			jsii.String("source"),
		},
		time: []*string{
			jsii.String("time"),
		},
		version: []*string{
			jsii.String("version"),
		},
	},
	ruleName: jsii.String("ruleName"),
}

type EventField

type EventField interface {
	awscdk.IResolvable
	// The creation stack of this resolvable which will be appended to errors thrown during resolution.
	//
	// This may return an array with a single informational element indicating how
	// to get this property populated, if it was skipped for performance reasons.
	CreationStack() *[]*string
	// Human readable display hint about the event pattern.
	DisplayHint() *string
	// the path to a field in the event pattern.
	Path() *string
	// Produce the Token's value at resolution time.
	Resolve(_ctx awscdk.IResolveContext) interface{}
	// Convert the path to the field in the event pattern to JSON.
	ToJSON() *string
	// Return a string representation of this resolvable object.
	//
	// Returns a reversible string representation.
	ToString() *string
}

Represents a field in the event pattern.

Example:

// Example automatically generated from non-compiling source. May contain errors.
import logs "github.com/aws/aws-cdk-go/awscdk"
var logGroup logGroup
var rule rule

rule.addTarget(targets.NewCloudWatchLogGroup(logGroup, &logGroupProps{
	logEvent: targets.logGroupTargetInput(map[string]interface{}{
		"timestamp": events.EventField.from(jsii.String("$.time")),
		"message": events.EventField.from(jsii.String("$.detail-type")),
	}),
}))

type EventPattern

type EventPattern struct {
	// The 12-digit number identifying an AWS account.
	Account *[]*string `field:"optional" json:"account" yaml:"account"`
	// A JSON object, whose content is at the discretion of the service originating the event.
	Detail *map[string]interface{} `field:"optional" json:"detail" yaml:"detail"`
	// Identifies, in combination with the source field, the fields and values that appear in the detail field.
	//
	// Represents the "detail-type" event field.
	DetailType *[]*string `field:"optional" json:"detailType" yaml:"detailType"`
	// A unique value is generated for every event.
	//
	// This can be helpful in
	// tracing events as they move through rules to targets, and are processed.
	Id *[]*string `field:"optional" json:"id" yaml:"id"`
	// Identifies the AWS region where the event originated.
	Region *[]*string `field:"optional" json:"region" yaml:"region"`
	// This JSON array contains ARNs that identify resources that are involved in the event.
	//
	// Inclusion of these ARNs is at the discretion of the
	// service.
	//
	// For example, Amazon EC2 instance state-changes include Amazon EC2
	// instance ARNs, Auto Scaling events include ARNs for both instances and
	// Auto Scaling groups, but API calls with AWS CloudTrail do not include
	// resource ARNs.
	Resources *[]*string `field:"optional" json:"resources" yaml:"resources"`
	// Identifies the service that sourced the event.
	//
	// All events sourced from
	// within AWS begin with "aws." Customer-generated events can have any value
	// here, as long as it doesn't begin with "aws." We recommend the use of
	// Java package-name style reverse domain-name strings.
	//
	// To find the correct value for source for an AWS service, see the table in
	// AWS Service Namespaces. For example, the source value for Amazon
	// CloudFront is aws.cloudfront.
	// See: http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces
	//
	Source *[]*string `field:"optional" json:"source" yaml:"source"`
	// The event timestamp, which can be specified by the service originating the event.
	//
	// If the event spans a time interval, the service might choose
	// to report the start time, so this value can be noticeably before the time
	// the event is actually received.
	Time *[]*string `field:"optional" json:"time" yaml:"time"`
	// By default, this is set to 0 (zero) in all events.
	Version *[]*string `field:"optional" json:"version" yaml:"version"`
}

Events in Amazon CloudWatch Events are represented as JSON objects. For more information about JSON objects, see RFC 7159.

**Important**: this class can only be used with a `Rule` class. In particular, do not use it with `CfnRule` class: your pattern will not be rendered correctly. In a `CfnRule` class, write the pattern as you normally would when directly writing CloudFormation.

Rules use event patterns to select events and route them to targets. A pattern either matches an event or it doesn't. Event patterns are represented as JSON objects with a structure that is similar to that of events.

It is important to remember the following about event pattern matching:

  • For a pattern to match an event, the event must contain all the field names listed in the pattern. The field names must appear in the event with the same nesting structure.
  • Other fields of the event not mentioned in the pattern are ignored; effectively, there is a “"*": "*"“ wildcard for fields not mentioned.
  • The matching is exact (character-by-character), without case-folding or any other string normalization.
  • The values being matched follow JSON rules: Strings enclosed in quotes, numbers, and the unquoted keywords true, false, and null.
  • Number matching is at the string representation level. For example, 300, 300.0, and 3.0e2 are not considered equal.

Example:

import lambda "github.com/aws/aws-cdk-go/awscdk"

fn := lambda.NewFunction(this, jsii.String("MyFunc"), &functionProps{
	runtime: lambda.runtime_NODEJS_14_X(),
	handler: jsii.String("index.handler"),
	code: lambda.code.fromInline(jsii.String("exports.handler = handler.toString()")),
})

rule := events.NewRule(this, jsii.String("rule"), &ruleProps{
	eventPattern: &eventPattern{
		source: []*string{
			jsii.String("aws.ec2"),
		},
	},
})

queue := sqs.NewQueue(this, jsii.String("Queue"))

rule.addTarget(targets.NewLambdaFunction(fn, &lambdaFunctionProps{
	deadLetterQueue: queue,
	 // Optional: add a dead letter queue
	maxEventAge: cdk.duration.hours(jsii.Number(2)),
	 // Optional: set the maxEventAge retry policy
	retryAttempts: jsii.Number(2),
}))

See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/CloudWatchEventsandEventPatterns.html

type HttpMethod added in v2.13.0

type HttpMethod string

Supported HTTP operations.

const (
	// POST.
	HttpMethod_POST HttpMethod = "POST"
	// GET.
	HttpMethod_GET HttpMethod = "GET"
	// HEAD.
	HttpMethod_HEAD HttpMethod = "HEAD"
	// OPTIONS.
	HttpMethod_OPTIONS HttpMethod = "OPTIONS"
	// PUT.
	HttpMethod_PUT HttpMethod = "PUT"
	// PATCH.
	HttpMethod_PATCH HttpMethod = "PATCH"
	// DELETE.
	HttpMethod_DELETE HttpMethod = "DELETE"
)

type HttpParameter added in v2.13.0

type HttpParameter interface {
}

An additional HTTP parameter to send along with the OAuth request.

Example:

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

var secretValue secretValue

httpParameter := awscdk.Aws_events.httpParameter.fromSecret(secretValue)

func HttpParameter_FromSecret added in v2.13.0

func HttpParameter_FromSecret(value awscdk.SecretValue) HttpParameter

Make an OAuthParameter from a secret.

func HttpParameter_FromString added in v2.13.0

func HttpParameter_FromString(value *string) HttpParameter

Make an OAuthParameter from a string value.

The value is not treated as a secret.

type IApiDestination added in v2.13.0

type IApiDestination interface {
	awscdk.IResource
	// The ARN of the Api Destination created.
	ApiDestinationArn() *string
	// The Name of the Api Destination created.
	ApiDestinationName() *string
}

Interface for API Destinations.

type IConnection added in v2.13.0

type IConnection interface {
	awscdk.IResource
	// The ARN of the connection created.
	ConnectionArn() *string
	// The Name for the connection.
	ConnectionName() *string
	// The ARN for the secret created for the connection.
	ConnectionSecretArn() *string
}

Interface for EventBus Connections.

func Connection_FromConnectionAttributes added in v2.13.0

func Connection_FromConnectionAttributes(scope constructs.Construct, id *string, attrs *ConnectionAttributes) IConnection

Import an existing connection resource.

func Connection_FromEventBusArn added in v2.13.0

func Connection_FromEventBusArn(scope constructs.Construct, id *string, connectionArn *string, connectionSecretArn *string) IConnection

Import an existing connection resource.

type IEventBus

type IEventBus interface {
	awscdk.IResource
	// Create an EventBridge archive to send events to.
	//
	// When you create an archive, incoming events might not immediately start being sent to the archive.
	// Allow a short period of time for changes to take effect.
	Archive(id *string, props *BaseArchiveProps) Archive
	// Grants an IAM Principal to send custom events to the eventBus so that they can be matched to rules.
	GrantPutEventsTo(grantee awsiam.IGrantable) awsiam.Grant
	// The ARN of this event bus resource.
	EventBusArn() *string
	// The physical ID of this event bus resource.
	EventBusName() *string
	// The JSON policy of this event bus resource.
	EventBusPolicy() *string
	// The partner event source to associate with this event bus resource.
	EventSourceName() *string
}

Interface which all EventBus based classes MUST implement.

func EventBus_FromEventBusArn

func EventBus_FromEventBusArn(scope constructs.Construct, id *string, eventBusArn *string) IEventBus

Import an existing event bus resource.

func EventBus_FromEventBusAttributes

func EventBus_FromEventBusAttributes(scope constructs.Construct, id *string, attrs *EventBusAttributes) IEventBus

Import an existing event bus resource.

func EventBus_FromEventBusName

func EventBus_FromEventBusName(scope constructs.Construct, id *string, eventBusName *string) IEventBus

Import an existing event bus resource.

type IRule

type IRule interface {
	awscdk.IResource
	// The value of the event rule Amazon Resource Name (ARN), such as arn:aws:events:us-east-2:123456789012:rule/example.
	RuleArn() *string
	// The name event rule.
	RuleName() *string
}

Represents an EventBridge Rule.

func Rule_FromEventRuleArn

func Rule_FromEventRuleArn(scope constructs.Construct, id *string, eventRuleArn *string) IRule

Import an existing EventBridge Rule provided an ARN.

type IRuleTarget

type IRuleTarget interface {
	// Returns the rule target specification.
	//
	// NOTE: Do not use the various `inputXxx` options. They can be set in a call to `addTarget`.
	Bind(rule IRule, id *string) *RuleTargetConfig
}

An abstract target for EventRules.

type Match added in v2.37.0

type Match interface {
	awscdk.IResolvable
	// The creation stack of this resolvable which will be appended to errors thrown during resolution.
	//
	// This may return an array with a single informational element indicating how
	// to get this property populated, if it was skipped for performance reasons.
	CreationStack() *[]*string
	// A representation of this matcher as a list of strings.
	AsList() *[]*string
	// Produce the Token's value at resolution time.
	Resolve(context awscdk.IResolveContext) interface{}
	// Return a string representation of this resolvable object.
	//
	// Returns a reversible string representation.
	ToString() *string
}

An event pattern matcher.

Example:

// Example automatically generated from non-compiling source. May contain errors.
rule := events.NewRule(this, jsii.String("rule"), &ruleProps{
	eventPattern: &eventPattern{
		detail: map[string]interface{}{
			"object": map[string][]*string{
				// Matchers may appear at any level
				"size": events.Match.greaterThan(jsii.Number(1024)),
			},

			// 'OR' condition
			"source-storage-class": events.Match.anyOf(events.Match.prefix(jsii.String("GLACIER")), events.Match.exactString(jsii.String("DEEP_ARCHIVE"))),
		},
		detailtype: events.match.equalsIgnoreCase(jsii.String("object created")),

		// If you prefer, you can use a low level array of strings, as directly consumed by EventBridge
		source: []*string{
			jsii.String("aws.s3"),
		},

		region: events.*match.anythingButPrefix(jsii.String("us-gov")),
	},
})

type OAuthAuthorizationProps added in v2.13.0

type OAuthAuthorizationProps struct {
	// The URL to the authorization endpoint.
	AuthorizationEndpoint *string `field:"required" json:"authorizationEndpoint" yaml:"authorizationEndpoint"`
	// The client ID to use for OAuth authorization for the connection.
	ClientId *string `field:"required" json:"clientId" yaml:"clientId"`
	// The client secret associated with the client ID to use for OAuth authorization for the connection.
	ClientSecret awscdk.SecretValue `field:"required" json:"clientSecret" yaml:"clientSecret"`
	// The method to use for the authorization request.
	//
	// (Can only choose POST, GET or PUT).
	HttpMethod HttpMethod `field:"required" json:"httpMethod" yaml:"httpMethod"`
	// Additional string parameters to add to the OAuth request body.
	BodyParameters *map[string]HttpParameter `field:"optional" json:"bodyParameters" yaml:"bodyParameters"`
	// Additional string parameters to add to the OAuth request header.
	HeaderParameters *map[string]HttpParameter `field:"optional" json:"headerParameters" yaml:"headerParameters"`
	// Additional string parameters to add to the OAuth request query string.
	QueryStringParameters *map[string]HttpParameter `field:"optional" json:"queryStringParameters" yaml:"queryStringParameters"`
}

Properties for `Authorization.oauth()`.

Example:

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

var httpParameter httpParameter
var secretValue secretValue

oAuthAuthorizationProps := &oAuthAuthorizationProps{
	authorizationEndpoint: jsii.String("authorizationEndpoint"),
	clientId: jsii.String("clientId"),
	clientSecret: secretValue,
	httpMethod: awscdk.Aws_events.httpMethod_POST,

	// the properties below are optional
	bodyParameters: map[string]*httpParameter{
		"bodyParametersKey": httpParameter,
	},
	headerParameters: map[string]*httpParameter{
		"headerParametersKey": httpParameter,
	},
	queryStringParameters: map[string]*httpParameter{
		"queryStringParametersKey": httpParameter,
	},
}

type OnEventOptions

type OnEventOptions struct {
	// The scope to use if the source of the rule and its target are in different Stacks (but in the same account & region).
	//
	// This helps dealing with cycles that often arise in these situations.
	CrossStackScope constructs.Construct `field:"optional" json:"crossStackScope" yaml:"crossStackScope"`
	// A description of the rule's purpose.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// Additional restrictions for the event to route to the specified target.
	//
	// The method that generates the rule probably imposes some type of event
	// filtering. The filtering implied by what you pass here is added
	// on top of that filtering.
	// See: https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html
	//
	EventPattern *EventPattern `field:"optional" json:"eventPattern" yaml:"eventPattern"`
	// A name for the rule.
	RuleName *string `field:"optional" json:"ruleName" yaml:"ruleName"`
	// The target to register for the event.
	Target IRuleTarget `field:"optional" json:"target" yaml:"target"`
}

Standard set of options for `onXxx` event handlers on construct.

Example:

// Lambda function containing logic that evaluates compliance with the rule.
evalComplianceFn := lambda.NewFunction(this, jsii.String("CustomFunction"), &functionProps{
	code: lambda.assetCode.fromInline(jsii.String("exports.handler = (event) => console.log(event);")),
	handler: jsii.String("index.handler"),
	runtime: lambda.runtime_NODEJS_14_X(),
})

// A custom rule that runs on configuration changes of EC2 instances
customRule := config.NewCustomRule(this, jsii.String("Custom"), &customRuleProps{
	configurationChanges: jsii.Boolean(true),
	lambdaFunction: evalComplianceFn,
	ruleScope: config.ruleScope.fromResource(config.resourceType_EC2_INSTANCE()),
})

// A rule to detect stack drifts
driftRule := config.NewCloudFormationStackDriftDetectionCheck(this, jsii.String("Drift"))

// Topic to which compliance notification events will be published
complianceTopic := sns.NewTopic(this, jsii.String("ComplianceTopic"))

// Send notification on compliance change events
driftRule.onComplianceChange(jsii.String("ComplianceChange"), &onEventOptions{
	target: targets.NewSnsTopic(complianceTopic),
})

type Rule

type Rule interface {
	awscdk.Resource
	IRule
	// 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 value of the event rule Amazon Resource Name (ARN), such as arn:aws:events:us-east-2:123456789012:rule/example.
	RuleArn() *string
	// The name event rule.
	RuleName() *string
	// The stack in which this resource is defined.
	Stack() awscdk.Stack
	// Adds an event pattern filter to this rule.
	//
	// If a pattern was already specified,
	// these values are merged into the existing pattern.
	//
	// For example, if the rule already contains the pattern:
	//
	//     {
	//       "resources": [ "r1" ],
	//       "detail": {
	//         "hello": [ 1 ]
	//       }
	//     }
	//
	// And `addEventPattern` is called with the pattern:
	//
	//     {
	//       "resources": [ "r2" ],
	//       "detail": {
	//         "foo": [ "bar" ]
	//       }
	//     }
	//
	// The resulting event pattern will be:
	//
	//     {
	//       "resources": [ "r1", "r2" ],
	//       "detail": {
	//         "hello": [ 1 ],
	//         "foo": [ "bar" ]
	//       }
	// }.
	AddEventPattern(eventPattern *EventPattern)
	// Adds a target to the rule. The abstract class RuleTarget can be extended to define new targets.
	//
	// No-op if target is undefined.
	AddTarget(target IRuleTarget)
	// 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
	ValidateRule() *[]*string
}

Defines an EventBridge Rule in this stack.

Example:

import lambda "github.com/aws/aws-cdk-go/awscdk"

fn := lambda.NewFunction(this, jsii.String("MyFunc"), &functionProps{
	runtime: lambda.runtime_NODEJS_14_X(),
	handler: jsii.String("index.handler"),
	code: lambda.code.fromInline(jsii.String("exports.handler = handler.toString()")),
})

rule := events.NewRule(this, jsii.String("rule"), &ruleProps{
	eventPattern: &eventPattern{
		source: []*string{
			jsii.String("aws.ec2"),
		},
	},
})

queue := sqs.NewQueue(this, jsii.String("Queue"))

rule.addTarget(targets.NewLambdaFunction(fn, &lambdaFunctionProps{
	deadLetterQueue: queue,
	 // Optional: add a dead letter queue
	maxEventAge: cdk.duration.hours(jsii.Number(2)),
	 // Optional: set the maxEventAge retry policy
	retryAttempts: jsii.Number(2),
}))

func NewRule

func NewRule(scope constructs.Construct, id *string, props *RuleProps) Rule

type RuleProps

type RuleProps struct {
	// The scope to use if the source of the rule and its target are in different Stacks (but in the same account & region).
	//
	// This helps dealing with cycles that often arise in these situations.
	CrossStackScope constructs.Construct `field:"optional" json:"crossStackScope" yaml:"crossStackScope"`
	// A description of the rule's purpose.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// Additional restrictions for the event to route to the specified target.
	//
	// The method that generates the rule probably imposes some type of event
	// filtering. The filtering implied by what you pass here is added
	// on top of that filtering.
	// See: https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html
	//
	EventPattern *EventPattern `field:"optional" json:"eventPattern" yaml:"eventPattern"`
	// A name for the rule.
	RuleName *string `field:"optional" json:"ruleName" yaml:"ruleName"`
	// Indicates whether the rule is enabled.
	Enabled *bool `field:"optional" json:"enabled" yaml:"enabled"`
	// The event bus to associate with this rule.
	EventBus IEventBus `field:"optional" json:"eventBus" yaml:"eventBus"`
	// The schedule or rate (frequency) that determines when EventBridge runs the rule.
	//
	// You must specify this property, the `eventPattern` property, or both.
	//
	// For more information, see Schedule Expression Syntax for
	// Rules in the Amazon EventBridge User Guide.
	// See: https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html
	//
	Schedule Schedule `field:"optional" json:"schedule" yaml:"schedule"`
	// Targets to invoke when this rule matches an event.
	//
	// Input will be the full matched event. If you wish to specify custom
	// target input, use `addTarget(target[, inputOptions])`.
	Targets *[]IRuleTarget `field:"optional" json:"targets" yaml:"targets"`
}

Properties for defining an EventBridge Rule.

Example:

connection := events.NewConnection(this, jsii.String("Connection"), &connectionProps{
	authorization: events.authorization.apiKey(jsii.String("x-api-key"), awscdk.SecretValue.secretsManager(jsii.String("ApiSecretName"))),
	description: jsii.String("Connection with API Key x-api-key"),
})

destination := events.NewApiDestination(this, jsii.String("Destination"), &apiDestinationProps{
	connection: connection,
	endpoint: jsii.String("https://example.com"),
	description: jsii.String("Calling example.com with API key x-api-key"),
})

rule := events.NewRule(this, jsii.String("Rule"), &ruleProps{
	schedule: events.schedule.rate(cdk.duration.minutes(jsii.Number(1))),
	targets: []iRuleTarget{
		targets.NewApiDestination(destination),
	},
})

type RuleTargetConfig

type RuleTargetConfig struct {
	// The Amazon Resource Name (ARN) of the target.
	Arn *string `field:"required" json:"arn" yaml:"arn"`
	// Parameters used when the rule invokes Amazon AWS Batch Job/Queue.
	BatchParameters *CfnRule_BatchParametersProperty `field:"optional" json:"batchParameters" yaml:"batchParameters"`
	// Contains information about a dead-letter queue configuration.
	DeadLetterConfig *CfnRule_DeadLetterConfigProperty `field:"optional" json:"deadLetterConfig" yaml:"deadLetterConfig"`
	// The Amazon ECS task definition and task count to use, if the event target is an Amazon ECS task.
	EcsParameters *CfnRule_EcsParametersProperty `field:"optional" json:"ecsParameters" yaml:"ecsParameters"`
	// Contains the HTTP parameters to use when the target is a API Gateway REST endpoint or EventBridge API destination.
	HttpParameters *CfnRule_HttpParametersProperty `field:"optional" json:"httpParameters" yaml:"httpParameters"`
	// What input to send to the event target.
	Input RuleTargetInput `field:"optional" json:"input" yaml:"input"`
	// Settings that control shard assignment, when the target is a Kinesis stream.
	//
	// If you don't include this parameter, eventId is used as the
	// partition key.
	KinesisParameters *CfnRule_KinesisParametersProperty `field:"optional" json:"kinesisParameters" yaml:"kinesisParameters"`
	// A RetryPolicy object that includes information about the retry policy settings.
	RetryPolicy *CfnRule_RetryPolicyProperty `field:"optional" json:"retryPolicy" yaml:"retryPolicy"`
	// Role to use to invoke this event target.
	Role awsiam.IRole `field:"optional" json:"role" yaml:"role"`
	// Parameters used when the rule invokes Amazon EC2 Systems Manager Run Command.
	RunCommandParameters *CfnRule_RunCommandParametersProperty `field:"optional" json:"runCommandParameters" yaml:"runCommandParameters"`
	// Parameters used when the FIFO sqs queue is used an event target by the rule.
	SqsParameters *CfnRule_SqsParametersProperty `field:"optional" json:"sqsParameters" yaml:"sqsParameters"`
	// The resource that is backing this target.
	//
	// This is the resource that will actually have some action performed on it when used as a target
	// (for example, start a build for a CodeBuild project).
	// We need it to determine whether the rule belongs to a different account than the target -
	// if so, we generate a more complex setup,
	// including an additional stack containing the EventBusPolicy.
	// See: https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-cross-account-event-delivery.html
	//
	TargetResource constructs.IConstruct `field:"optional" json:"targetResource" yaml:"targetResource"`
}

Properties for an event rule target.

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 role role
var ruleTargetInput ruleTargetInput

ruleTargetConfig := &ruleTargetConfig{
	arn: jsii.String("arn"),

	// the properties below are optional
	batchParameters: &batchParametersProperty{
		jobDefinition: jsii.String("jobDefinition"),
		jobName: jsii.String("jobName"),

		// the properties below are optional
		arrayProperties: &batchArrayPropertiesProperty{
			size: jsii.Number(123),
		},
		retryStrategy: &batchRetryStrategyProperty{
			attempts: jsii.Number(123),
		},
	},
	deadLetterConfig: &deadLetterConfigProperty{
		arn: jsii.String("arn"),
	},
	ecsParameters: &ecsParametersProperty{
		taskDefinitionArn: jsii.String("taskDefinitionArn"),

		// the properties below are optional
		capacityProviderStrategy: []interface{}{
			&capacityProviderStrategyItemProperty{
				capacityProvider: jsii.String("capacityProvider"),

				// the properties below are optional
				base: jsii.Number(123),
				weight: jsii.Number(123),
			},
		},
		enableEcsManagedTags: jsii.Boolean(false),
		enableExecuteCommand: jsii.Boolean(false),
		group: jsii.String("group"),
		launchType: jsii.String("launchType"),
		networkConfiguration: &networkConfigurationProperty{
			awsVpcConfiguration: &awsVpcConfigurationProperty{
				subnets: []*string{
					jsii.String("subnets"),
				},

				// the properties below are optional
				assignPublicIp: jsii.String("assignPublicIp"),
				securityGroups: []*string{
					jsii.String("securityGroups"),
				},
			},
		},
		placementConstraints: []interface{}{
			&placementConstraintProperty{
				expression: jsii.String("expression"),
				type: jsii.String("type"),
			},
		},
		placementStrategies: []interface{}{
			&placementStrategyProperty{
				field: jsii.String("field"),
				type: jsii.String("type"),
			},
		},
		platformVersion: jsii.String("platformVersion"),
		propagateTags: jsii.String("propagateTags"),
		referenceId: jsii.String("referenceId"),
		tagList: []interface{}{
			&cfnTag{
				key: jsii.String("key"),
				value: jsii.String("value"),
			},
		},
		taskCount: jsii.Number(123),
	},
	httpParameters: &httpParametersProperty{
		headerParameters: map[string]*string{
			"headerParametersKey": jsii.String("headerParameters"),
		},
		pathParameterValues: []*string{
			jsii.String("pathParameterValues"),
		},
		queryStringParameters: map[string]*string{
			"queryStringParametersKey": jsii.String("queryStringParameters"),
		},
	},
	input: ruleTargetInput,
	kinesisParameters: &kinesisParametersProperty{
		partitionKeyPath: jsii.String("partitionKeyPath"),
	},
	retryPolicy: &retryPolicyProperty{
		maximumEventAgeInSeconds: jsii.Number(123),
		maximumRetryAttempts: jsii.Number(123),
	},
	role: role,
	runCommandParameters: &runCommandParametersProperty{
		runCommandTargets: []interface{}{
			&runCommandTargetProperty{
				key: jsii.String("key"),
				values: []*string{
					jsii.String("values"),
				},
			},
		},
	},
	sqsParameters: &sqsParametersProperty{
		messageGroupId: jsii.String("messageGroupId"),
	},
	targetResource: construct,
}

type RuleTargetInput

type RuleTargetInput interface {
	// Return the input properties for this input object.
	Bind(rule IRule) *RuleTargetInputProperties
}

The input to send to the event target.

Example:

import iam "github.com/aws/aws-cdk-go/awscdk"
import sfn "github.com/aws/aws-cdk-go/awscdk"

rule := events.NewRule(this, jsii.String("Rule"), &ruleProps{
	schedule: events.schedule.rate(cdk.duration.minutes(jsii.Number(1))),
})

dlq := sqs.NewQueue(this, jsii.String("DeadLetterQueue"))

role := iam.NewRole(this, jsii.String("Role"), &roleProps{
	assumedBy: iam.NewServicePrincipal(jsii.String("events.amazonaws.com")),
})
stateMachine := sfn.NewStateMachine(this, jsii.String("SM"), &stateMachineProps{
	definition: sfn.NewWait(this, jsii.String("Hello"), &waitProps{
		time: sfn.waitTime.duration(cdk.*duration.seconds(jsii.Number(10))),
	}),
})

rule.addTarget(targets.NewSfnStateMachine(stateMachine, &sfnStateMachineProps{
	input: events.ruleTargetInput.fromObject(map[string]*string{
		"SomeParam": jsii.String("SomeValue"),
	}),
	deadLetterQueue: dlq,
	role: role,
}))

func RuleTargetInput_FromEventPath

func RuleTargetInput_FromEventPath(path *string) RuleTargetInput

Take the event target input from a path in the event JSON.

func RuleTargetInput_FromMultilineText

func RuleTargetInput_FromMultilineText(text *string) RuleTargetInput

Pass text to the event target, splitting on newlines.

This is only useful when passing to a target that does not take a single argument.

May contain strings returned by `EventField.from()` to substitute in parts of the matched event.

func RuleTargetInput_FromObject

func RuleTargetInput_FromObject(obj interface{}) RuleTargetInput

Pass a JSON object to the event target.

May contain strings returned by `EventField.from()` to substitute in parts of the matched event.

func RuleTargetInput_FromText

func RuleTargetInput_FromText(text *string) RuleTargetInput

Pass text to the event target.

May contain strings returned by `EventField.from()` to substitute in parts of the matched event.

The Rule Target input value will be a single string: the string you pass here. Do not use this method to pass a complex value like a JSON object to a Rule Target. Use `RuleTargetInput.fromObject()` instead.

type RuleTargetInputProperties

type RuleTargetInputProperties struct {
	// Literal input to the target service (must be valid JSON).
	Input *string `field:"optional" json:"input" yaml:"input"`
	// JsonPath to take input from the input event.
	InputPath *string `field:"optional" json:"inputPath" yaml:"inputPath"`
	// Paths map to extract values from event and insert into `inputTemplate`.
	InputPathsMap *map[string]*string `field:"optional" json:"inputPathsMap" yaml:"inputPathsMap"`
	// Input template to insert paths map into.
	InputTemplate *string `field:"optional" json:"inputTemplate" yaml:"inputTemplate"`
}

The input properties for an event target.

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"

ruleTargetInputProperties := &ruleTargetInputProperties{
	input: jsii.String("input"),
	inputPath: jsii.String("inputPath"),
	inputPathsMap: map[string]*string{
		"inputPathsMapKey": jsii.String("inputPathsMap"),
	},
	inputTemplate: jsii.String("inputTemplate"),
}

type Schedule

type Schedule interface {
	// Retrieve the expression for this schedule.
	ExpressionString() *string
}

Schedule for scheduled event rules.

Note that rates cannot be defined in fractions of minutes.

Example:

connection := events.NewConnection(this, jsii.String("Connection"), &connectionProps{
	authorization: events.authorization.apiKey(jsii.String("x-api-key"), awscdk.SecretValue.secretsManager(jsii.String("ApiSecretName"))),
	description: jsii.String("Connection with API Key x-api-key"),
})

destination := events.NewApiDestination(this, jsii.String("Destination"), &apiDestinationProps{
	connection: connection,
	endpoint: jsii.String("https://example.com"),
	description: jsii.String("Calling example.com with API key x-api-key"),
})

rule := events.NewRule(this, jsii.String("Rule"), &ruleProps{
	schedule: events.schedule.rate(cdk.duration.minutes(jsii.Number(1))),
	targets: []iRuleTarget{
		targets.NewApiDestination(destination),
	},
})

See: https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html

func Schedule_Cron

func Schedule_Cron(options *CronOptions) Schedule

Create a schedule from a set of cron fields.

func Schedule_Expression

func Schedule_Expression(expression *string) Schedule

Construct a schedule from a literal schedule expression.

func Schedule_Rate

func Schedule_Rate(duration awscdk.Duration) Schedule

Construct a schedule from an interval and a time unit.

Rates may be defined with any unit of time, but when converted into minutes, the duration must be a positive whole number of minutes.

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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