Show / Hide Table of Contents

LambdaSharp::S3::WriteJson

The LambdaSharp::S3::WriteJson type creates a resource that writes a JSON file to an S3 bucket.

On creation and update, the Contents property is serialized into a JSON document and written to the S3 bucket. On deletion, the JSON document is deleted from the S3 bucket.

Using

Using:

  - Module: LambdaSharp.S3.IO:0.5@lambdasharp

Syntax

Type: LambdaSharp::S3::WriteJson
Properties:
  Bucket: String
  Key: String
  Contents: JSON

Properties

Bucket

The Bucket property specifies the destination S3 bucket name or ARN.

Required: Yes

Type: String

Contents

The Contents property specifies the contents of the JSON document to be written.

Required: Yes

Type: Boolean

Key

The Key property specifies the destination key where the JSON file is written to.

Required: Yes

Type: Boolean

Attributes

Url

The Url attribute contains the S3 URL of the bucket and key: s3://bucket-name/key.

Type: String

Examples

Write a config.json file that contains the API Gateway URL

- Resource: MyBucket
  Type: AWS::S3::Bucket

- Resource: WriteConfigJson
  Type: LambdaSharp::S3::WriteJson
  Properties:
    Bucket: !Ref MyBucket
    Key: config.json
    Contents:
      Api: !Ref Module::RestApi::Url
In This Article
Back to top Generated by DocFX