S3PutObjectActionProps

class aws_cdk.aws_iot_actions.S3PutObjectActionProps(*, role=None, access_control=None, key=None)

Bases: CommonActionProps

(experimental) Configuration properties of an action for s3.

Parameters:
  • role (Optional[IRole]) – (experimental) The IAM role that allows access to AWS service. Default: a new role will be created

  • access_control (Optional[BucketAccessControl]) – (experimental) The Amazon S3 canned ACL that controls access to the object identified by the object key. Default: None

  • key (Optional[str]) – (experimental) The path to the file where the data is written. Supports substitution templates. Default: ‘${topic()}/${timestamp()}’

Stability:

experimental

ExampleMetadata:

infused

Example:

bucket = s3.Bucket(self, "MyBucket")

iot.TopicRule(self, "TopicRule",
    sql=iot.IotSql.from_string_as_ver20160323("SELECT topic(2) as device_id, year, month, day FROM 'device/+/data'"),
    actions=[
        actions.S3PutObjectAction(bucket,
            key="${year}/${month}/${day}/${topic(2)}"
        )
    ]
)

Attributes

access_control

(experimental) The Amazon S3 canned ACL that controls access to the object identified by the object key.

Default:

None

See:

https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#canned-acl

Stability:

experimental

key

(experimental) The path to the file where the data is written.

Supports substitution templates.

Default:

‘${topic()}/${timestamp()}’

See:

https://docs.aws.amazon.com/iot/latest/developerguide/iot-substitution-templates.html

Stability:

experimental

role

(experimental) The IAM role that allows access to AWS service.

Default:

a new role will be created

Stability:

experimental