Skip to content
v2.278.0

MultipartBodyOptions Struct ​

Options when creating MultipartBody.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
const multipartBodyOptions: ec2.MultipartBodyOptions = {
  contentType: 'contentType',

  // the properties below are optional
  body: 'body',
  transferEncoding: 'transferEncoding',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

multipart_body_options = ec2.MultipartBodyOptions(
    content_type="contentType",

    # the properties below are optional
    body="body",
    transfer_encoding="transferEncoding"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ec2.*;

MultipartBodyOptions multipartBodyOptions = MultipartBodyOptions.builder()
        .contentType("contentType")

        // the properties below are optional
        .body("body")
        .transferEncoding("transferEncoding")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;

var multipartBodyOptions = new MultipartBodyOptions {
    ContentType = "contentType",

    // the properties below are optional
    Body = "body",
    TransferEncoding = "transferEncoding"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

multipartBodyOptions := &MultipartBodyOptions{
	ContentType: jsii.String("contentType"),

	// the properties below are optional
	Body: jsii.String("body"),
	TransferEncoding: jsii.String("transferEncoding"),
}

Properties ​

bodyoptionalstringbodyoptionalstrbodyoptionalStringBodyoptionalstringBodyoptional*string #
The body of message.

Default: undefined - body will not be added to part

contentTypestringcontent_typestrcontentTypeStringContentTypestringContentType*string required #
`Content-Type` header of this part.

Some examples of content types:

  • text/x-shellscript; charset="utf-8" (shell script)
  • text/cloud-boothook; charset="utf-8" (shell script executed during boot phase)

For Linux shell scripts use text/x-shellscript.

transferEncodingoptionalstringtransfer_encodingoptionalstrtransferEncodingoptionalStringTransferEncodingoptionalstringTransferEncodingoptional*string #
`Content-Transfer-Encoding` header specifying part encoding.

Default: undefined - body is not encoded