Experimental
@aws-cdk/aws-imagebuilder-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
S3WorkflowData Class
Helper class for S3-based workflow data references, containing additional permission grant methods on the S3 object.
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@staticmethod def from_asset(scope: Construct, id: str, path: str, options: typing.Optional[AssetOptions] = None) -> S3WorkflowDatapublic static S3WorkflowData fromAsset(Construct scope, String id, String path, AssetOptions options)public static S3WorkflowData FromAsset(Construct scope, string id, string path, AssetOptions? options = null)func FromAsset(Scope Construct, Id *string, Path *string, Options AssetOptions) S3WorkflowDatastatic#Uploads workflow data from a local file to S3 to use as the workflow data.
4 parameters
Parameters
scopescopescopescopeScope— The construct scope.ididididId— Identifier of the construct.pathpathpathpathPath— The local path to the workflow data file.optionsoptionsoptionsoptionsOptions— S3 asset upload options.
fromInline(data: string): WorkflowData@staticmethod def from_inline(data: str) -> WorkflowDatapublic static WorkflowData fromInline(String data)public static WorkflowData FromInline(string data)func FromInline(Data *string) WorkflowDatastatic#Uses an inline JSON or YAML string as the workflow data.
1 parameter
Parameters
datadatadatadataData— An inline JSON or YAML string representing the workflow data.
fromJsonObject(data: { [key: string]: any }): WorkflowData@staticmethod def from_json_object(data: typing.Mapping[str, Any]) -> WorkflowDatapublic static WorkflowData fromJsonObject(Map<String, Object> data)public static WorkflowData FromJsonObject(IDictionary<string, object> data)func FromJsonObject(Data *map[string]interface{}) WorkflowDatastatic#Uses an inline JSON object as the workflow data.
1 parameter
Parameters
datadatadatadataData— An inline JSON object representing the workflow data.
fromS3(bucket: IBucket, key: string): S3WorkflowData // chainable@staticmethod def from_s3(bucket: IBucket, key: str) -> S3WorkflowDatapublic static S3WorkflowData fromS3(IBucket bucket, String key)public static S3WorkflowData FromS3(IBucket bucket, string key)func FromS3(Bucket IBucket, Key *string) S3WorkflowDatastatic#References workflow data from a pre-existing S3 object.
2 parameters
Parameters
bucketbucketbucketbucketBucket— The S3 bucket where the workflow data is stored.keykeykeykeyKey— The S3 key of the workflow data file.
grantPut(grantee: IGrantable): Grantdef grant_put(self, grantee: IGrantable) -> Grantpublic Grant grantPut(IGrantable grantee)public Grant GrantPut(IGrantable grantee)func GrantPut(Grantee IGrantable) Grant#Grant put permissions to the given grantee for the workflow data in S3 [disable-awslint:no-grants].
1 parameter
Parameters
granteegranteegranteegranteeGrantee— The principal.
grantRead(grantee: IGrantable): Grantdef grant_read(self, grantee: IGrantable) -> Grantpublic Grant grantRead(IGrantable grantee)public Grant GrantRead(IGrantable grantee)func GrantRead(Grantee IGrantable) Grant#Grant read permissions to the given grantee for the workflow data in S3 [disable-awslint:no-grants].
1 parameter
Parameters
granteegranteegranteegranteeGrantee— The principal.
render(): WorkflowDataConfigdef render(self, ) -> WorkflowDataConfigpublic WorkflowDataConfig render()public WorkflowDataConfig Render()func Render() WorkflowDataConfig#The rendered workflow data text, for use in CloudFormation.