awsecrassets

package
v2.22.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2022 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DockerImageAsset_IsConstruct

func DockerImageAsset_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead.

func NewDockerImageAsset_Override

func NewDockerImageAsset_Override(d DockerImageAsset, scope constructs.Construct, id *string, props *DockerImageAssetProps)

func NewTarballImageAsset_Override

func NewTarballImageAsset_Override(t TarballImageAsset, scope constructs.Construct, id *string, props *TarballImageAssetProps)

func TarballImageAsset_IsConstruct

func TarballImageAsset_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead.

Types

type DockerImageAsset

type DockerImageAsset interface {
	constructs.Construct
	// 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.
	AssetHash() *string
	// The full URI of the image (including a tag).
	//
	// Use this reference to pull
	// the asset.
	ImageUri() *string
	SetImageUri(val *string)
	// The tree node.
	Node() constructs.Node
	// Repository where the image is stored.
	Repository() awsecr.IRepository
	SetRepository(val awsecr.IRepository)
	// 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
	//
	AddResourceMetadata(resource awscdk.CfnResource, resourceProperty *string)
	// Returns a string representation of this construct.
	ToString() *string
}

An asset that represents a Docker image.

The image will be created in build time and uploaded to an ECR repository.

Example:

import awscdk "github.com/aws/aws-cdk-go/awscdk"type DockerImageAsset awscdk.DockerImageAsset
type NetworkMode awscdk.NetworkMode

asset := NewDockerImageAsset(this, jsii.String("MyBuildImage"), &dockerImageAssetProps{
	directory: path.join(__dirname, jsii.String("my-image")),
	networkMode: networkMode_HOST(),
})

func NewDockerImageAsset

func NewDockerImageAsset(scope constructs.Construct, id *string, props *DockerImageAssetProps) DockerImageAsset

type DockerImageAssetInvalidationOptions

type DockerImageAssetInvalidationOptions struct {
	// Use `buildArgs` while calculating the asset hash.
	BuildArgs *bool `json:"buildArgs" yaml:"buildArgs"`
	// Use `extraHash` while calculating the asset hash.
	ExtraHash *bool `json:"extraHash" yaml:"extraHash"`
	// Use `file` while calculating the asset hash.
	File *bool `json:"file" yaml:"file"`
	// Use `networkMode` while calculating the asset hash.
	NetworkMode *bool `json:"networkMode" yaml:"networkMode"`
	// Use `repositoryName` while calculating the asset hash.
	RepositoryName *bool `json:"repositoryName" yaml:"repositoryName"`
	// Use `target` while calculating the asset hash.
	Target *bool `json:"target" yaml:"target"`
}

Options to control invalidation of `DockerImageAsset` asset hashes.

Example:

import awscdk "github.com/aws/aws-cdk-go/awscdk"type DockerImageAsset awscdk.DockerImageAsset

asset := 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),
	},
})

type DockerImageAssetOptions

type DockerImageAssetOptions struct {
	// Glob patterns to exclude from the copy.
	Exclude *[]*string `json:"exclude" yaml:"exclude"`
	// A strategy for how to handle symlinks.
	FollowSymlinks awscdk.SymlinkFollowMode `json:"followSymlinks" yaml:"followSymlinks"`
	// The ignore behavior to use for exclude patterns.
	IgnoreMode awscdk.IgnoreMode `json:"ignoreMode" yaml:"ignoreMode"`
	// Extra information to encode into the fingerprint (e.g. build instructions and other inputs).
	ExtraHash *string `json:"extraHash" yaml:"extraHash"`
	// 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`).
	BuildArgs *map[string]*string `json:"buildArgs" yaml:"buildArgs"`
	// Path to the Dockerfile (relative to the directory).
	File *string `json:"file" yaml:"file"`
	// Options to control which parameters are used to invalidate the asset hash.
	Invalidation *DockerImageAssetInvalidationOptions `json:"invalidation" yaml:"invalidation"`
	// Networking mode for the RUN commands during build.
	//
	// Support docker API 1.25+.
	NetworkMode NetworkMode `json:"networkMode" yaml:"networkMode"`
	// Docker target to build to.
	Target *string `json:"target" yaml:"target"`
}

Options for DockerImageAsset.

Example:

import cdk "github.com/aws/aws-cdk-go/awscdk"import awscdk "github.com/aws/aws-cdk-go/awscdk"import ecr_assets "github.com/aws/aws-cdk-go/awscdk/aws_ecr_assets"

var networkMode networkMode
dockerImageAssetOptions := &dockerImageAssetOptions{
	buildArgs: map[string]*string{
		"buildArgsKey": jsii.String("buildArgs"),
	},
	exclude: []*string{
		jsii.String("exclude"),
	},
	extraHash: jsii.String("extraHash"),
	file: jsii.String("file"),
	followSymlinks: cdk.symlinkFollowMode_NEVER,
	ignoreMode: cdk.ignoreMode_GLOB,
	invalidation: &dockerImageAssetInvalidationOptions{
		buildArgs: jsii.Boolean(false),
		extraHash: jsii.Boolean(false),
		file: jsii.Boolean(false),
		networkMode: jsii.Boolean(false),
		repositoryName: jsii.Boolean(false),
		target: jsii.Boolean(false),
	},
	networkMode: networkMode,
	target: jsii.String("target"),
}

type DockerImageAssetProps

type DockerImageAssetProps struct {
	// Glob patterns to exclude from the copy.
	Exclude *[]*string `json:"exclude" yaml:"exclude"`
	// A strategy for how to handle symlinks.
	FollowSymlinks awscdk.SymlinkFollowMode `json:"followSymlinks" yaml:"followSymlinks"`
	// The ignore behavior to use for exclude patterns.
	IgnoreMode awscdk.IgnoreMode `json:"ignoreMode" yaml:"ignoreMode"`
	// Extra information to encode into the fingerprint (e.g. build instructions and other inputs).
	ExtraHash *string `json:"extraHash" yaml:"extraHash"`
	// 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`).
	BuildArgs *map[string]*string `json:"buildArgs" yaml:"buildArgs"`
	// Path to the Dockerfile (relative to the directory).
	File *string `json:"file" yaml:"file"`
	// Options to control which parameters are used to invalidate the asset hash.
	Invalidation *DockerImageAssetInvalidationOptions `json:"invalidation" yaml:"invalidation"`
	// Networking mode for the RUN commands during build.
	//
	// Support docker API 1.25+.
	NetworkMode NetworkMode `json:"networkMode" yaml:"networkMode"`
	// Docker target to build to.
	Target *string `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
	Directory *string `json:"directory" yaml:"directory"`
}

Props for DockerImageAssets.

Example:

import awscdk "github.com/aws/aws-cdk-go/awscdk"type DockerImageAsset awscdk.DockerImageAsset

asset := 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),
	},
})

type NetworkMode added in v2.11.0

type NetworkMode interface {
	// The networking mode to use for docker build.
	Mode() *string
}

networking mode on build time supported by docker.

Example:

import awscdk "github.com/aws/aws-cdk-go/awscdk"type DockerImageAsset awscdk.DockerImageAsset
type NetworkMode awscdk.NetworkMode

asset := NewDockerImageAsset(this, jsii.String("MyBuildImage"), &dockerImageAssetProps{
	directory: path.join(__dirname, jsii.String("my-image")),
	networkMode: networkMode_HOST(),
})

func NetworkMode_Custom added in v2.11.0

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.

func NetworkMode_DEFAULT added in v2.11.0

func NetworkMode_DEFAULT() NetworkMode

func NetworkMode_FromContainer added in v2.11.0

func NetworkMode_FromContainer(containerId *string) NetworkMode

Reuse another container's network stack.

func NetworkMode_HOST added in v2.11.0

func NetworkMode_HOST() NetworkMode

func NetworkMode_NONE added in v2.11.0

func NetworkMode_NONE() NetworkMode

type TarballImageAsset

type TarballImageAsset interface {
	constructs.Construct
	// 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.
	AssetHash() *string
	// The full URI of the image (including a tag).
	//
	// Use this reference to pull
	// the asset.
	ImageUri() *string
	SetImageUri(val *string)
	// The tree node.
	Node() constructs.Node
	// Repository where the image is stored.
	Repository() awsecr.IRepository
	SetRepository(val awsecr.IRepository)
	// Returns a string representation of this construct.
	ToString() *string
}

An asset that represents a Docker image.

The image will loaded from an existing tarball and uploaded to an ECR repository.

Example:

import awscdk "github.com/aws/aws-cdk-go/awscdk"type TarballImageAsset awscdk.TarballImageAsset

asset := NewTarballImageAsset(this, jsii.String("MyBuildImage"), &tarballImageAssetProps{
	tarballFile: jsii.String("local-image.tar"),
})

func NewTarballImageAsset

func NewTarballImageAsset(scope constructs.Construct, id *string, props *TarballImageAssetProps) TarballImageAsset

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.
	TarballFile *string `json:"tarballFile" yaml:"tarballFile"`
}

Options for TarballImageAsset.

Example:

import awscdk "github.com/aws/aws-cdk-go/awscdk"type TarballImageAsset awscdk.TarballImageAsset

asset := NewTarballImageAsset(this, jsii.String("MyBuildImage"), &tarballImageAssetProps{
	tarballFile: jsii.String("local-image.tar"),
})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL