AWS Cloudformation IoTAnalytics ServiceManagedS3 YAML

51 views Asked by At

I have a AWS Cloudformation template (yaml-format) like this:

Datastore:
    Type: AWS::IoTAnalytics::Datastore
    Properties:
      DatastoreName: "DatastoreName"
      DatastoreStorage:
        ServiceManagedS3: ""
      RetentionPeriod:
        NumberOfDays: 7

I want to define a ServiceManagedS3-Bucket. Official documentation (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotanalytics-datastore-servicemanageds3.html) says it should just be an empty object. But when I do like above I get the following error: Property validation failure: [Value of property {/DatastoreStorage/ServiceManagedS3} does not match type {Object}]. If I change to an empty row like following Cloudformation complains about a null value.

      DatastoreStorage:
        ServiceManagedS3:
          
      RetentionPeriod:
        NumberOfDays: 7

Am I using the wrong .yaml-Syntax or what else am I doing wrong here? What is the correct way to declare an empty object?

1

There are 1 answers

0
Marcin On BEST ANSWER

Based on the comments.

The empty ServiceManagedS3 object is defined as follows:

ServiceManagedS3: {}

Therefore, the resource should be:

Datastore:
    Type: AWS::IoTAnalytics::Datastore
    Properties:
      DatastoreName: "DatastoreName"
      DatastoreStorage:
        ServiceManagedS3: {}
      RetentionPeriod:
        NumberOfDays: 7