> **Experimental**
>
> `@aws-cdk/aws-imagebuilder-alpha` is an [**experimental**](/stability) (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 › S3WorkflowData

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

## Example

```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,
});
```

## 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.
