AwsApiCall

class aws_cdk.integ_tests.AwsApiCall(scope, id, *, api, service, parameters=None)

Bases: Construct

(experimental) Construct that creates a custom resource that will perform a query using the AWS SDK.

Stability:

experimental

ExampleMetadata:

infused

Example:

# my_app_stack: Stack


AwsApiCall(my_app_stack, "GetObject",
    service="S3",
    api="getObject"
)
Parameters:
  • scope (Construct) –

  • id (str) –

  • api (str) – (experimental) The api call to make, i.e. getBucketLifecycle.

  • service (str) – (experimental) The AWS service, i.e. S3.

  • parameters (Optional[Any]) – (experimental) Any parameters to pass to the api call. Default: - no parameters

Stability:

experimental

Methods

assert_at_path(path, expected)

(experimental) Assert that the ExpectedResult is equal to the result of the AwsApiCall at the given path.

For example the SQS.receiveMessage api response would look like:

If you wanted to assert the value of Body you could do

Parameters:
Stability:

experimental

Return type:

None

expect(expected)

(experimental) Assert that the ExpectedResult is equal to the result of the AwsApiCall.

Parameters:

expected (ExpectedResult) –

Stability:

experimental

Return type:

None

get_att(attribute_name)

(experimental) Returns the value of an attribute of the custom resource of an arbitrary type.

Attributes are returned from the custom resource provider through the Data map where the key is the attribute name.

Parameters:

attribute_name (str) –

Stability:

experimental

Return type:

Reference

get_att_string(attribute_name)

(experimental) Returns the value of an attribute of the custom resource of type string.

Attributes are returned from the custom resource provider through the Data map where the key is the attribute name.

Parameters:

attribute_name (str) –

Stability:

experimental

Return type:

str

to_string()

Returns a string representation of this construct.

Return type:

str

Attributes

node

The construct tree node associated with this construct.

Static Methods

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters:

x (Any) –

Return type:

bool