> **Experimental**
>
> `@aws-cdk/aws-imagebuilder-alpha` is an [**experimental**](https://docs.aws.amazon.com/cdk/api/stability.html) (alpha) package: its API may change in any release, without a major version bump.
# S3WorkflowData

Helper class for S3-based workflow data references, containing additional permission grant methods on the S3 object.

Extends: [WorkflowData](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-imagebuilder-alpha.WorkflowData.html) › S3WorkflowData
Obtainable from: [WorkflowData.fromAsset](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-imagebuilder-alpha.WorkflowData.html#fromasset), [WorkflowData.fromS3](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-imagebuilder-alpha.WorkflowData.html#froms3)

- Stability: [Experimental](https://docs.aws.amazon.com/cdk/api/stability.html)
- Source: [`lib/workflow.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/@aws-cdk/aws-imagebuilder-alpha/lib/workflow.ts#L413)

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as imagebuilder_alpha from '@aws-cdk/aws-imagebuilder-alpha';
import * as cdk from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';
import { aws_kms as interfaces_kms } from 'aws-cdk-lib/interfaces';

declare const dockerImage: cdk.DockerImage;
declare const grantable: iam.IGrantable;
declare const keyRef: interfaces_kms.IKeyRef;
declare const localBundling: cdk.ILocalBundling;
const s3WorkflowData = imagebuilder_alpha.S3WorkflowData.fromAsset(this, 'MyS3WorkflowData', 'path', /* all optional props */ {
  assetHash: 'assetHash',
  assetHashType: cdk.AssetHashType.SOURCE,
  bundling: {
    image: dockerImage,

    // the properties below are optional
    bundlingFileAccess: cdk.BundlingFileAccess.VOLUME_COPY,
    command: ['command'],
    entrypoint: ['entrypoint'],
    environment: {
      environmentKey: 'environment',
    },
    local: localBundling,
    network: 'network',
    outputType: cdk.BundlingOutput.ARCHIVED,
    platform: 'platform',
    securityOpt: 'securityOpt',
    user: 'user',
    volumes: [{
      containerPath: 'containerPath',
      hostPath: 'hostPath',

      // the properties below are optional
      consistency: cdk.DockerVolumeConsistency.CONSISTENT,
    }],
    volumesFrom: ['volumesFrom'],
    workingDirectory: 'workingDirectory',
  },
  deployTime: false,
  displayName: 'displayName',
  exclude: ['exclude'],
  followSymlinks: cdk.SymlinkFollowMode.NEVER,
  ignoreMode: cdk.IgnoreMode.GLOB,
  readers: [grantable],
  sourceKMSKey: keyRef,
});
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_imagebuilder_alpha as imagebuilder_alpha
import aws_cdk as cdk
from aws_cdk import aws_iam as iam
from aws_cdk.interfaces import aws_kms as interfaces_kms

# docker_image: cdk.DockerImage
# grantable: iam.IGrantable
# key_ref: interfaces_kms.IKeyRef
# local_bundling: cdk.ILocalBundling

s3_workflow_data = imagebuilder_alpha.S3WorkflowData.from_asset(self, "MyS3WorkflowData", "path",
    asset_hash="assetHash",
    asset_hash_type=cdk.AssetHashType.SOURCE,
    bundling=cdk.BundlingOptions(
        image=docker_image,

        # the properties below are optional
        bundling_file_access=cdk.BundlingFileAccess.VOLUME_COPY,
        command=["command"],
        entrypoint=["entrypoint"],
        environment={
            "environment_key": "environment"
        },
        local=local_bundling,
        network="network",
        output_type=cdk.BundlingOutput.ARCHIVED,
        platform="platform",
        security_opt="securityOpt",
        user="user",
        volumes=[cdk.DockerVolume(
            container_path="containerPath",
            host_path="hostPath",

            # the properties below are optional
            consistency=cdk.DockerVolumeConsistency.CONSISTENT
        )],
        volumes_from=["volumesFrom"],
        working_directory="workingDirectory"
    ),
    deploy_time=False,
    display_name="displayName",
    exclude=["exclude"],
    follow_symlinks=cdk.SymlinkFollowMode.NEVER,
    ignore_mode=cdk.IgnoreMode.GLOB,
    readers=[grantable],
    source_kms_key=key_ref
)
```

Java:

```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.imagebuilder.alpha.*;
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.iam.*;
import software.amazon.awscdk.interfaces.kms.*;

DockerImage dockerImage;
IGrantable grantable;
IKeyRef keyRef;
ILocalBundling localBundling;

S3WorkflowData s3WorkflowData = S3WorkflowData.fromAsset(this, "MyS3WorkflowData", "path", AssetOptions.builder()
        .assetHash("assetHash")
        .assetHashType(AssetHashType.SOURCE)
        .bundling(BundlingOptions.builder()
                .image(dockerImage)

                // the properties below are optional
                .bundlingFileAccess(BundlingFileAccess.VOLUME_COPY)
                .command(List.of("command"))
                .entrypoint(List.of("entrypoint"))
                .environment(Map.of(
                        "environmentKey", "environment"))
                .local(localBundling)
                .network("network")
                .outputType(BundlingOutput.ARCHIVED)
                .platform("platform")
                .securityOpt("securityOpt")
                .user("user")
                .volumes(List.of(DockerVolume.builder()
                        .containerPath("containerPath")
                        .hostPath("hostPath")

                        // the properties below are optional
                        .consistency(DockerVolumeConsistency.CONSISTENT)
                        .build()))
                .volumesFrom(List.of("volumesFrom"))
                .workingDirectory("workingDirectory")
                .build())
        .deployTime(false)
        .displayName("displayName")
        .exclude(List.of("exclude"))
        .followSymlinks(SymlinkFollowMode.NEVER)
        .ignoreMode(IgnoreMode.GLOB)
        .readers(List.of(grantable))
        .sourceKMSKey(keyRef)
        .build());
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.ImageBuilder.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ImageBuilder.Alpha;
using Amazon.CDK;
using Amazon.CDK.AWS.IAM;
using Amazon.CDK.Interfaces.KMS;

DockerImage dockerImage;
IGrantable grantable;
IKeyRef keyRef;
ILocalBundling localBundling;

var s3WorkflowData = S3WorkflowData.FromAsset(this, "MyS3WorkflowData", "path", new AssetOptions {
    AssetHash = "assetHash",
    AssetHashType = AssetHashType.SOURCE,
    Bundling = new BundlingOptions {
        Image = dockerImage,

        // the properties below are optional
        BundlingFileAccess = BundlingFileAccess.VOLUME_COPY,
        Command = new [] { "command" },
        Entrypoint = new [] { "entrypoint" },
        Environment = new Dictionary<string, string> {
            { "environmentKey", "environment" }
        },
        Local = localBundling,
        Network = "network",
        OutputType = BundlingOutput.ARCHIVED,
        Platform = "platform",
        SecurityOpt = "securityOpt",
        User = "user",
        Volumes = new [] { new DockerVolume {
            ContainerPath = "containerPath",
            HostPath = "hostPath",

            // the properties below are optional
            Consistency = DockerVolumeConsistency.CONSISTENT
        } },
        VolumesFrom = new [] { "volumesFrom" },
        WorkingDirectory = "workingDirectory"
    },
    DeployTime = false,
    DisplayName = "displayName",
    Exclude = new [] { "exclude" },
    FollowSymlinks = SymlinkFollowMode.NEVER,
    IgnoreMode = IgnoreMode.GLOB,
    Readers = new [] { grantable },
    SourceKMSKey = keyRef
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awsimagebuilderalpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import imagebuilder_alpha "github.com/aws/aws-cdk-go/awsimagebuilderalpha"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var dockerImage DockerImage
var grantable IGrantable
var keyRef IKeyRef
var localBundling ILocalBundling

s3WorkflowData := imagebuilder_alpha.S3WorkflowData_FromAsset(this, jsii.String("MyS3WorkflowData"), jsii.String("path"), &AssetOptions{
	AssetHash: jsii.String("assetHash"),
	AssetHashType: cdk.AssetHashType_SOURCE,
	Bundling: &BundlingOptions{
		Image: dockerImage,

		// the properties below are optional
		BundlingFileAccess: cdk.BundlingFileAccess_VOLUME_COPY,
		Command: []*string{
			jsii.String("command"),
		},
		Entrypoint: []*string{
			jsii.String("entrypoint"),
		},
		Environment: map[string]*string{
			"environmentKey": jsii.String("environment"),
		},
		Local: localBundling,
		Network: jsii.String("network"),
		OutputType: cdk.BundlingOutput_ARCHIVED,
		Platform: jsii.String("platform"),
		SecurityOpt: jsii.String("securityOpt"),
		User: jsii.String("user"),
		Volumes: []DockerVolume{
			&DockerVolume{
				ContainerPath: jsii.String("containerPath"),
				HostPath: jsii.String("hostPath"),

				// the properties below are optional
				Consistency: cdk.DockerVolumeConsistency_CONSISTENT,
			},
		},
		VolumesFrom: []*string{
			jsii.String("volumesFrom"),
		},
		WorkingDirectory: jsii.String("workingDirectory"),
	},
	DeployTime: jsii.Boolean(false),
	DisplayName: jsii.String("displayName"),
	Exclude: []*string{
		jsii.String("exclude"),
	},
	FollowSymlinks: cdk.SymlinkFollowMode_NEVER,
	IgnoreMode: cdk.IgnoreMode_GLOB,
	Readers: []IGrantable{
		grantable,
	},
	SourceKMSKey: keyRef,
})
```

## Methods

- `fromAsset(scope: Construct, id: string, path: string, options?: AssetOptions): S3WorkflowData // chainable` (static) — Uploads workflow data from a local file to S3 to use as the workflow data.

  **Parameters**

  - `scope` — The construct scope.
  - `id` — Identifier of the construct.
  - `path` — The local path to the workflow data file.
  - `options` — S3 asset upload options.

- `fromInline(data: string): WorkflowData` (static) — Uses an inline JSON or YAML string as the workflow data.

  **Parameters**

  - `data` — An inline JSON or YAML string representing the workflow data.

- `fromJsonObject(data: { [key: string]: any }): WorkflowData` (static) — Uses an inline JSON object as the workflow data.

  **Parameters**

  - `data` — An inline JSON object representing the workflow data.

- `fromS3(bucket: IBucket, key: string): S3WorkflowData // chainable` (static) — References workflow data from a pre-existing S3 object.

  **Parameters**

  - `bucket` — The S3 bucket where the workflow data is stored.
  - `key` — The S3 key of the workflow data file.

- `grantPut(grantee: IGrantable): Grant` — Grant put permissions to the given grantee for the workflow data in S3 [disable-awslint:no-grants].

  **Parameters**

  - `grantee` — The principal.

- `grantRead(grantee: IGrantable): Grant` — Grant read permissions to the given grantee for the workflow data in S3 [disable-awslint:no-grants].

  **Parameters**

  - `grantee` — The principal.

- `render(): WorkflowDataConfig` — The rendered workflow data text, for use in CloudFormation.
