FirehoseLogDestination

class aws_cdk.aws_apigateway.FirehoseLogDestination(stream)

Bases: object

Use a Firehose delivery stream as a custom access log destination for API Gateway.

ExampleMetadata:

infused

Example:

destination_bucket = s3.Bucket(self, "Bucket")
delivery_stream_role = iam.Role(self, "Role",
    assumed_by=iam.ServicePrincipal("firehose.amazonaws.com")
)

stream = firehose.CfnDeliveryStream(self, "MyStream",
    delivery_stream_name="amazon-apigateway-delivery-stream",
    s3_destination_configuration=firehose.CfnDeliveryStream.S3DestinationConfigurationProperty(
        bucket_arn=destination_bucket.bucket_arn,
        role_arn=delivery_stream_role.role_arn
    )
)

api = apigateway.RestApi(self, "books",
    deploy_options=apigateway.StageOptions(
        access_log_destination=apigateway.FirehoseLogDestination(stream),
        access_log_format=apigateway.AccessLogFormat.json_with_standard_fields()
    )
)
Parameters:

stream (CfnDeliveryStream) –

Methods

bind(_stage)

Binds this destination to the Firehose delivery stream.

Parameters:

_stage (IStage) –

Return type:

AccessLogDestinationConfig