Documentation
¶
Index ¶
- func DockerImageAsset_IsConstruct(x interface{}) *bool
- func NewDockerImageAsset_Override(d DockerImageAsset, scope constructs.Construct, id *string, ...)
- func NewTarballImageAsset_Override(t TarballImageAsset, scope constructs.Construct, id *string, ...)
- func TarballImageAsset_IsConstruct(x interface{}) *bool
- type DockerImageAsset
- type DockerImageAssetInvalidationOptions
- type DockerImageAssetOptions
- type DockerImageAssetProps
- type NetworkMode
- type Platform
- type TarballImageAsset
- type TarballImageAssetProps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DockerImageAsset_IsConstruct ¶
func DockerImageAsset_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
func NewDockerImageAsset_Override ¶
func NewDockerImageAsset_Override(d DockerImageAsset, scope constructs.Construct, id *string, props *DockerImageAssetProps)
Experimental.
func NewTarballImageAsset_Override ¶
func NewTarballImageAsset_Override(t TarballImageAsset, scope constructs.Construct, id *string, props *TarballImageAssetProps)
Experimental.
func TarballImageAsset_IsConstruct ¶
func TarballImageAsset_IsConstruct(x interface{}) *bool
Return whether the given object is a Construct. Experimental.
Types ¶
type DockerImageAsset ¶
type DockerImageAsset interface {
awscdk.Construct
assets.IAsset
// A hash of this asset, which is available at construction time.
//
// As this is a plain string, it
// can be used in construct IDs in order to enforce creation of a new resource when the content
// hash has changed.
// Experimental.
AssetHash() *string
// The full URI of the image (including a tag).
//
// Use this reference to pull
// the asset.
// Experimental.
ImageUri() *string
// Experimental.
SetImageUri(val *string)
// The construct tree node associated with this construct.
// Experimental.
Node() awscdk.ConstructNode
// Repository where the image is stored.
// Experimental.
Repository() awsecr.IRepository
// Experimental.
SetRepository(val awsecr.IRepository)
// A hash of the source of this asset, which is available at construction time.
//
// As this is a plain
// string, it can be used in construct IDs in order to enforce creation of a new resource when
// the content hash has changed.
// Deprecated: use assetHash.
SourceHash() *string
// Adds CloudFormation template metadata to the specified resource with information that indicates which resource property is mapped to this local asset.
//
// This can be used by tools such as SAM CLI to provide local
// experience such as local invocation and debugging of Lambda functions.
//
// Asset metadata will only be included if the stack is synthesized with the
// "aws:cdk:enable-asset-metadata" context key defined, which is the default
// behavior when synthesizing via the CDK Toolkit.
// See: https://github.com/aws/aws-cdk/issues/1432
//
// Experimental.
AddResourceMetadata(resource awscdk.CfnResource, resourceProperty *string)
// Perform final modifications before synthesis.
//
// This method can be implemented by derived constructs in order to perform
// final changes before synthesis. prepare() will be called after child
// constructs have been prepared.
//
// This is an advanced framework feature. Only use this if you
// understand the implications.
// Experimental.
OnPrepare()
// Allows this construct to emit artifacts into the cloud assembly during synthesis.
//
// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
// as they participate in synthesizing the cloud assembly.
// Experimental.
OnSynthesize(session constructs.ISynthesisSession)
// Validate the current construct.
//
// This method can be implemented by derived constructs in order to perform
// validation logic. It is called on all constructs before synthesis.
//
// Returns: An array of validation error messages, or an empty array if the construct is valid.
// Experimental.
OnValidate() *[]*string
// Perform final modifications before synthesis.
//
// This method can be implemented by derived constructs in order to perform
// final changes before synthesis. prepare() will be called after child
// constructs have been prepared.
//
// This is an advanced framework feature. Only use this if you
// understand the implications.
// Experimental.
Prepare()
// Allows this construct to emit artifacts into the cloud assembly during synthesis.
//
// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
// as they participate in synthesizing the cloud assembly.
// Experimental.
Synthesize(session awscdk.ISynthesisSession)
// Returns a string representation of this construct.
// Experimental.
ToString() *string
// Validate the current construct.
//
// This method can be implemented by derived constructs in order to perform
// validation logic. It is called on all constructs before synthesis.
//
// Returns: An array of validation error messages, or an empty array if the construct is valid.
// Experimental.
Validate() *[]*string
}
An asset that represents a Docker image.
The image will be created in build time and uploaded to an ECR repository.
Example:
import "github.com/aws/aws-cdk-go/awscdk"
asset := awscdk.NewDockerImageAsset(this, jsii.String("MyBuildImage"), &dockerImageAssetProps{
directory: path.join(__dirname, jsii.String("my-image")),
networkMode: awscdk.NetworkMode_HOST(),
})
Experimental.
func NewDockerImageAsset ¶
func NewDockerImageAsset(scope constructs.Construct, id *string, props *DockerImageAssetProps) DockerImageAsset
Experimental.
type DockerImageAssetInvalidationOptions ¶
type DockerImageAssetInvalidationOptions struct {
// Use `buildArgs` while calculating the asset hash.
// Experimental.
BuildArgs *bool `field:"optional" json:"buildArgs" yaml:"buildArgs"`
// Use `extraHash` while calculating the asset hash.
// Experimental.
ExtraHash *bool `field:"optional" json:"extraHash" yaml:"extraHash"`
// Use `file` while calculating the asset hash.
// Experimental.
File *bool `field:"optional" json:"file" yaml:"file"`
// Use `networkMode` while calculating the asset hash.
// Experimental.
NetworkMode *bool `field:"optional" json:"networkMode" yaml:"networkMode"`
// Use `platform` while calculating the asset hash.
// Experimental.
Platform *bool `field:"optional" json:"platform" yaml:"platform"`
// Use `repositoryName` while calculating the asset hash.
// Experimental.
RepositoryName *bool `field:"optional" json:"repositoryName" yaml:"repositoryName"`
// Use `target` while calculating the asset hash.
// Experimental.
Target *bool `field:"optional" json:"target" yaml:"target"`
}
Options to control invalidation of `DockerImageAsset` asset hashes.
Example:
import "github.com/aws/aws-cdk-go/awscdk"
asset := awscdk.NewDockerImageAsset(this, jsii.String("MyBuildImage"), &dockerImageAssetProps{
directory: path.join(__dirname, jsii.String("my-image")),
buildArgs: map[string]*string{
"HTTP_PROXY": jsii.String("http://10.20.30.2:1234"),
},
invalidation: &dockerImageAssetInvalidationOptions{
buildArgs: jsii.Boolean(false),
},
})
Experimental.
type DockerImageAssetOptions ¶
type DockerImageAssetOptions struct {
// Glob patterns to exclude from the copy.
// Experimental.
Exclude *[]*string `field:"optional" json:"exclude" yaml:"exclude"`
// A strategy for how to handle symlinks.
// Deprecated: use `followSymlinks` instead.
Follow assets.FollowMode `field:"optional" json:"follow" yaml:"follow"`
// The ignore behavior to use for exclude patterns.
// Experimental.
IgnoreMode awscdk.IgnoreMode `field:"optional" json:"ignoreMode" yaml:"ignoreMode"`
// Extra information to encode into the fingerprint (e.g. build instructions and other inputs).
// Experimental.
ExtraHash *string `field:"optional" json:"extraHash" yaml:"extraHash"`
// A strategy for how to handle symlinks.
// Experimental.
FollowSymlinks awscdk.SymlinkFollowMode `field:"optional" json:"followSymlinks" yaml:"followSymlinks"`
// Build args to pass to the `docker build` command.
//
// Since Docker build arguments are resolved before deployment, keys and
// values cannot refer to unresolved tokens (such as `lambda.functionArn` or
// `queue.queueUrl`).
// Experimental.
BuildArgs *map[string]*string `field:"optional" json:"buildArgs" yaml:"buildArgs"`
// Path to the Dockerfile (relative to the directory).
// Experimental.
File *string `field:"optional" json:"file" yaml:"file"`
// Options to control which parameters are used to invalidate the asset hash.
// Experimental.
Invalidation *DockerImageAssetInvalidationOptions `field:"optional" json:"invalidation" yaml:"invalidation"`
// Networking mode for the RUN commands during build.
//
// Support docker API 1.25+.
// Experimental.
NetworkMode NetworkMode `field:"optional" json:"networkMode" yaml:"networkMode"`
// Platform to build for.
//
// _Requires Docker Buildx_.
// Experimental.
Platform Platform `field:"optional" json:"platform" yaml:"platform"`
// ECR repository name.
//
// Specify this property if you need to statically address the image, e.g.
// from a Kubernetes Pod. Note, this is only the repository name, without the
// registry and the tag parts.
// Deprecated: to control the location of docker image assets, please override
// `Stack.addDockerImageAsset`. this feature will be removed in future
// releases.
RepositoryName *string `field:"optional" json:"repositoryName" yaml:"repositoryName"`
// Docker target to build to.
// Experimental.
Target *string `field:"optional" json:"target" yaml:"target"`
}
Options for DockerImageAsset.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import monocdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
var networkMode networkMode
var platform platform
dockerImageAssetOptions := &dockerImageAssetOptions{
buildArgs: map[string]*string{
"buildArgsKey": jsii.String("buildArgs"),
},
exclude: []*string{
jsii.String("exclude"),
},
extraHash: jsii.String("extraHash"),
file: jsii.String("file"),
follow: awscdk.Assets.followMode_NEVER,
followSymlinks: monocdk.symlinkFollowMode_NEVER,
ignoreMode: monocdk.ignoreMode_GLOB,
invalidation: &dockerImageAssetInvalidationOptions{
buildArgs: jsii.Boolean(false),
extraHash: jsii.Boolean(false),
file: jsii.Boolean(false),
networkMode: jsii.Boolean(false),
platform: jsii.Boolean(false),
repositoryName: jsii.Boolean(false),
target: jsii.Boolean(false),
},
networkMode: networkMode,
platform: platform,
repositoryName: jsii.String("repositoryName"),
target: jsii.String("target"),
}
Experimental.
type DockerImageAssetProps ¶
type DockerImageAssetProps struct {
// Glob patterns to exclude from the copy.
// Experimental.
Exclude *[]*string `field:"optional" json:"exclude" yaml:"exclude"`
// A strategy for how to handle symlinks.
// Deprecated: use `followSymlinks` instead.
Follow assets.FollowMode `field:"optional" json:"follow" yaml:"follow"`
// The ignore behavior to use for exclude patterns.
// Experimental.
IgnoreMode awscdk.IgnoreMode `field:"optional" json:"ignoreMode" yaml:"ignoreMode"`
// Extra information to encode into the fingerprint (e.g. build instructions and other inputs).
// Experimental.
ExtraHash *string `field:"optional" json:"extraHash" yaml:"extraHash"`
// A strategy for how to handle symlinks.
// Experimental.
FollowSymlinks awscdk.SymlinkFollowMode `field:"optional" json:"followSymlinks" yaml:"followSymlinks"`
// Build args to pass to the `docker build` command.
//
// Since Docker build arguments are resolved before deployment, keys and
// values cannot refer to unresolved tokens (such as `lambda.functionArn` or
// `queue.queueUrl`).
// Experimental.
BuildArgs *map[string]*string `field:"optional" json:"buildArgs" yaml:"buildArgs"`
// Path to the Dockerfile (relative to the directory).
// Experimental.
File *string `field:"optional" json:"file" yaml:"file"`
// Options to control which parameters are used to invalidate the asset hash.
// Experimental.
Invalidation *DockerImageAssetInvalidationOptions `field:"optional" json:"invalidation" yaml:"invalidation"`
// Networking mode for the RUN commands during build.
//
// Support docker API 1.25+.
// Experimental.
NetworkMode NetworkMode `field:"optional" json:"networkMode" yaml:"networkMode"`
// Platform to build for.
//
// _Requires Docker Buildx_.
// Experimental.
Platform Platform `field:"optional" json:"platform" yaml:"platform"`
// ECR repository name.
//
// Specify this property if you need to statically address the image, e.g.
// from a Kubernetes Pod. Note, this is only the repository name, without the
// registry and the tag parts.
// Deprecated: to control the location of docker image assets, please override
// `Stack.addDockerImageAsset`. this feature will be removed in future
// releases.
RepositoryName *string `field:"optional" json:"repositoryName" yaml:"repositoryName"`
// Docker target to build to.
// Experimental.
Target *string `field:"optional" json:"target" yaml:"target"`
// The directory where the Dockerfile is stored.
//
// Any directory inside with a name that matches the CDK output folder (cdk.out by default) will be excluded from the asset
// Experimental.
Directory *string `field:"required" json:"directory" yaml:"directory"`
}
Props for DockerImageAssets.
Example:
import "github.com/aws/aws-cdk-go/awscdk"
asset := awscdk.NewDockerImageAsset(this, jsii.String("MyBuildImage"), &dockerImageAssetProps{
directory: path.join(__dirname, jsii.String("my-image")),
buildArgs: map[string]*string{
"HTTP_PROXY": jsii.String("http://10.20.30.2:1234"),
},
invalidation: &dockerImageAssetInvalidationOptions{
buildArgs: jsii.Boolean(false),
},
})
Experimental.
type NetworkMode ¶
type NetworkMode interface {
// The networking mode to use for docker build.
// Experimental.
Mode() *string
}
networking mode on build time supported by docker.
Example:
import "github.com/aws/aws-cdk-go/awscdk"
asset := awscdk.NewDockerImageAsset(this, jsii.String("MyBuildImage"), &dockerImageAssetProps{
directory: path.join(__dirname, jsii.String("my-image")),
networkMode: awscdk.NetworkMode_HOST(),
})
Experimental.
func NetworkMode_Custom ¶
func NetworkMode_Custom(mode *string) NetworkMode
Used to specify a custom networking mode Use this if the networking mode name is not yet supported by the CDK. Experimental.
func NetworkMode_DEFAULT ¶
func NetworkMode_DEFAULT() NetworkMode
func NetworkMode_FromContainer ¶
func NetworkMode_FromContainer(containerId *string) NetworkMode
Reuse another container's network stack. Experimental.
func NetworkMode_HOST ¶
func NetworkMode_HOST() NetworkMode
func NetworkMode_NONE ¶
func NetworkMode_NONE() NetworkMode
type Platform ¶
type Platform interface {
// The platform to use for docker build.
// Experimental.
Platform() *string
}
platform supported by docker.
Example:
import "github.com/aws/aws-cdk-go/awscdk"
asset := awscdk.NewDockerImageAsset(this, jsii.String("MyBuildImage"), &dockerImageAssetProps{
directory: path.join(__dirname, jsii.String("my-image")),
platform: awscdk.Platform_LINUX_ARM64(),
})
Experimental.
func Platform_Custom ¶
Used to specify a custom platform Use this if the platform name is not yet supported by the CDK. Experimental.
func Platform_LINUX_AMD64 ¶
func Platform_LINUX_AMD64() Platform
func Platform_LINUX_ARM64 ¶
func Platform_LINUX_ARM64() Platform
type TarballImageAsset ¶
type TarballImageAsset interface {
awscdk.Construct
assets.IAsset
// A hash of this asset, which is available at construction time.
//
// As this is a plain string, it
// can be used in construct IDs in order to enforce creation of a new resource when the content
// hash has changed.
// Experimental.
AssetHash() *string
// The full URI of the image (including a tag).
//
// Use this reference to pull
// the asset.
// Experimental.
ImageUri() *string
// Experimental.
SetImageUri(val *string)
// The construct tree node associated with this construct.
// Experimental.
Node() awscdk.ConstructNode
// Repository where the image is stored.
// Experimental.
Repository() awsecr.IRepository
// Experimental.
SetRepository(val awsecr.IRepository)
// A hash of the source of this asset, which is available at construction time.
//
// As this is a plain
// string, it can be used in construct IDs in order to enforce creation of a new resource when
// the content hash has changed.
// Deprecated: use assetHash.
SourceHash() *string
// Perform final modifications before synthesis.
//
// This method can be implemented by derived constructs in order to perform
// final changes before synthesis. prepare() will be called after child
// constructs have been prepared.
//
// This is an advanced framework feature. Only use this if you
// understand the implications.
// Experimental.
OnPrepare()
// Allows this construct to emit artifacts into the cloud assembly during synthesis.
//
// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
// as they participate in synthesizing the cloud assembly.
// Experimental.
OnSynthesize(session constructs.ISynthesisSession)
// Validate the current construct.
//
// This method can be implemented by derived constructs in order to perform
// validation logic. It is called on all constructs before synthesis.
//
// Returns: An array of validation error messages, or an empty array if the construct is valid.
// Experimental.
OnValidate() *[]*string
// Perform final modifications before synthesis.
//
// This method can be implemented by derived constructs in order to perform
// final changes before synthesis. prepare() will be called after child
// constructs have been prepared.
//
// This is an advanced framework feature. Only use this if you
// understand the implications.
// Experimental.
Prepare()
// Allows this construct to emit artifacts into the cloud assembly during synthesis.
//
// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
// as they participate in synthesizing the cloud assembly.
// Experimental.
Synthesize(session awscdk.ISynthesisSession)
// Returns a string representation of this construct.
// Experimental.
ToString() *string
// Validate the current construct.
//
// This method can be implemented by derived constructs in order to perform
// validation logic. It is called on all constructs before synthesis.
//
// Returns: An array of validation error messages, or an empty array if the construct is valid.
// Experimental.
Validate() *[]*string
}
An asset that represents a Docker image.
The image will loaded from an existing tarball and uploaded to an ECR repository.
Example:
import "github.com/aws/aws-cdk-go/awscdk"
asset := awscdk.NewTarballImageAsset(this, jsii.String("MyBuildImage"), &tarballImageAssetProps{
tarballFile: jsii.String("local-image.tar"),
})
Experimental.
func NewTarballImageAsset ¶
func NewTarballImageAsset(scope constructs.Construct, id *string, props *TarballImageAssetProps) TarballImageAsset
Experimental.
type TarballImageAssetProps ¶
type TarballImageAssetProps struct {
// Absolute path to the tarball.
//
// It is recommended to to use the script running directory (e.g. `__dirname`
// in Node.js projects or dirname of `__file__` in Python) if your tarball
// is located as a resource inside your project.
// Experimental.
TarballFile *string `field:"required" json:"tarballFile" yaml:"tarballFile"`
}
Options for TarballImageAsset.
Example:
import "github.com/aws/aws-cdk-go/awscdk"
asset := awscdk.NewTarballImageAsset(this, jsii.String("MyBuildImage"), &tarballImageAssetProps{
tarballFile: jsii.String("local-image.tar"),
})
Experimental.