Class CfnApiDestination
- All Implemented Interfaces:
IInspectable,IApiDestinationRef,IEnvironmentAware,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
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::Connectionusing CloudFormation dynamic reference syntax. For more information, see Secrets Manager secrets .
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 .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.events.*;
CfnApiDestination cfnApiDestination = CfnApiDestination.Builder.create(this, "MyCfnApiDestination")
.connectionArn("connectionArn")
.httpMethod("httpMethod")
.invocationEndpoint("invocationEndpoint")
// the properties below are optional
.description("description")
.invocationRateLimitPerSecond(123)
.name("name")
.build();
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.events.IApiDestinationRef
IApiDestinationRef.Jsii$Default, IApiDestinationRef.Jsii$ProxyNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnApiDestination(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnApiDestination(software.amazon.jsii.JsiiObjectRef objRef) CfnApiDestination(software.constructs.Construct scope, String id, CfnApiDestinationProps props) Create a newAWS::Events::ApiDestination. -
Method Summary
Modifier and TypeMethodDescriptionstatic IApiDestinationReffromApiDestinationArn(software.constructs.Construct scope, String id, String arn) Creates a new IApiDestinationRef from an ARN.static IApiDestinationReffromApiDestinationName(software.constructs.Construct scope, String id, String apiDestinationName) Creates a new IApiDestinationRef from a apiDestinationName.A reference to a ApiDestination resource.The ARN of the API destination that was created by the request.Returns the Amazon Resource Name (ARN) of an API destination in resource format, so it can be used in theResourceelement of IAM permission policy statements.The ARN of the connection to use for the API destination.A description for the API destination to create.The method to use for the request to the HTTP invocation endpoint.The URL to the HTTP invocation endpoint for the API destination.The maximum number of requests per second to send to the HTTP invocation endpoint.getName()The name for the API destination to create.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetConnectionArn(String value) The ARN of the connection to use for the API destination.voidsetDescription(String value) A description for the API destination to create.voidsetHttpMethod(String value) The method to use for the request to the HTTP invocation endpoint.voidsetInvocationEndpoint(String value) The URL to the HTTP invocation endpoint for the API destination.voidThe maximum number of requests per second to send to the HTTP invocation endpoint.voidThe name for the API destination to create.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnApiDestination
protected CfnApiDestination(software.amazon.jsii.JsiiObjectRef objRef) -
CfnApiDestination
protected CfnApiDestination(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnApiDestination
@Stability(Stable) public CfnApiDestination(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnApiDestinationProps props) Create a newAWS::Events::ApiDestination.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
fromApiDestinationArn
@Stability(Stable) @NotNull public static IApiDestinationRef fromApiDestinationArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String arn) Creates a new IApiDestinationRef from an ARN.- Parameters:
scope- This parameter is required.id- This parameter is required.arn- This parameter is required.
-
fromApiDestinationName
@Stability(Stable) @NotNull public static IApiDestinationRef fromApiDestinationName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String apiDestinationName) Creates a new IApiDestinationRef from a apiDestinationName.- Parameters:
scope- This parameter is required.id- This parameter is required.apiDestinationName- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getApiDestinationRef
A reference to a ApiDestination resource.- Specified by:
getApiDestinationRefin interfaceIApiDestinationRef
-
getAttrArn
The ARN of the API destination that was created by the request. -
getAttrArnForPolicy
Returns the Amazon Resource Name (ARN) of an API destination in resource format, so it can be used in theResourceelement of IAM permission policy statements.For more information, see Resource types defined by Amazon EventBridge in the Service Authorization Reference .
For example, the following resource defines an IAM policy that grants permission to update a specific API destination.
Resources: ExamplePolicy: Type: AWS::IAM::Policy Properties: PolicyName: ExamplePolicy PolicyDocument: Version: '2012-10-17 ' Statement: - Effect: Allow Action: - events:UpdateApiDestination Resource: - !GetAtt myApiDestination.ArnForPolicy -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getConnectionArn
The ARN of the connection to use for the API destination. -
setConnectionArn
The ARN of the connection to use for the API destination. -
getHttpMethod
The method to use for the request to the HTTP invocation endpoint. -
setHttpMethod
The method to use for the request to the HTTP invocation endpoint. -
getInvocationEndpoint
The URL to the HTTP invocation endpoint for the API destination. -
setInvocationEndpoint
The URL to the HTTP invocation endpoint for the API destination. -
getDescription
A description for the API destination to create. -
setDescription
A description for the API destination to create. -
getInvocationRateLimitPerSecond
The maximum number of requests per second to send to the HTTP invocation endpoint. -
setInvocationRateLimitPerSecond
The maximum number of requests per second to send to the HTTP invocation endpoint. -
getName
The name for the API destination to create. -
setName
The name for the API destination to create.
-