Skip to content
v2.277.0

AwsApiInput Struct ​

Rule target input for an AwsApi target.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_events_targets as events_targets } from 'aws-cdk-lib';

declare const parameters: any;
const awsApiInput: events_targets.AwsApiInput = {
  action: 'action',
  service: 'service',

  // the properties below are optional
  apiVersion: 'apiVersion',
  catchErrorPattern: 'catchErrorPattern',
  parameters: parameters,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_events_targets as events_targets

# parameters: Any

aws_api_input = events_targets.AwsApiInput(
    action="action",
    service="service",

    # the properties below are optional
    api_version="apiVersion",
    catch_error_pattern="catchErrorPattern",
    parameters=parameters
)
java
// 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.targets.*;

Object parameters;

AwsApiInput awsApiInput = AwsApiInput.builder()
        .action("action")
        .service("service")

        // the properties below are optional
        .apiVersion("apiVersion")
        .catchErrorPattern("catchErrorPattern")
        .parameters(parameters)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Events.Targets;

var parameters;

var awsApiInput = new AwsApiInput {
    Action = "action",
    Service = "service",

    // the properties below are optional
    ApiVersion = "apiVersion",
    CatchErrorPattern = "catchErrorPattern",
    Parameters = parameters
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// 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 parameters interface{}

awsApiInput := &AwsApiInput{
	Action: jsii.String("action"),
	Service: jsii.String("service"),

	// the properties below are optional
	ApiVersion: jsii.String("apiVersion"),
	CatchErrorPattern: jsii.String("catchErrorPattern"),
	Parameters: parameters,
}

Properties ​

actionstringactionstractionStringActionstringAction*string required #
The service action to call.
apiVersionoptionalstringapi_versionoptionalstrapiVersionoptionalStringApiVersionoptionalstringApiVersionoptional*string deprecated #
the handler code was migrated to AWS SDK for JavaScript v3, which does not support this feature anymore
catchErrorPatternoptionalstringcatch_error_patternoptionalstrcatchErrorPatternoptionalStringCatchErrorPatternoptionalstringCatchErrorPatternoptional*string #
The regex pattern to use to catch API errors.

Default: do not catch errors

The code property of the Error object will be tested against this pattern. If there is a match an error will not be thrown.

parametersoptionalanyparametersoptionalAnyparametersoptionalObjectParametersoptionalobjectParametersoptionalinterface{} #
The parameters for the service action.

Default: no parameters

servicestringservicestrserviceStringServicestringService*string required #
The service to call.