@Stability(value=Experimental) public static final class BundlingOptions.Builder extends Object implements software.amazon.jsii.Builder<BundlingOptions>
BundlingOptions| Constructor and Description |
|---|
Builder() |
@Stability(value=Experimental) public BundlingOptions.Builder assetHash(String assetHash)
BundlingOptions.getAssetHash()assetHash - Specify a custom hash for this asset.
If assetHashType is set it must
be set to AssetHashType.CUSTOM. For consistency, this custom hash will
be SHA256 hashed and encoded as hex. The resulting hash will be the asset
hash.
NOTE: the hash is used in order to identify a specific revision of the asset, and used for optimizing and caching deployment activities related to this asset such as packaging, uploading to Amazon S3, etc. If you chose to customize the hash, you will need to make sure it is updated every time the asset changes, or otherwise it is possible that some deployments will not be invalidated.
this@Stability(value=Experimental) public BundlingOptions.Builder assetHashType(AssetHashType assetHashType)
BundlingOptions.getAssetHashType()assetHashType - Determines how the asset hash is calculated. Assets will get rebuilt and uploaded only if their hash has changed.
If the asset hash is set to OUTPUT (default), the hash is calculated
after bundling. This means that any change in the output will cause
the asset to be invalidated and uploaded. Bear in mind that the
go binary that is output can be different depending on the environment
that it was compiled in. If you want to control when the output is changed
it is recommended that you use immutable build images such as
public.ecr.aws/bitnami/golang:1.16.3-debian-10-r16.
If the asset hash is set to SOURCE, then only changes to the source
directory will cause the asset to rebuild. If your go project has multiple
Lambda functions this means that an update to any one function could cause
all the functions to be rebuilt and uploaded.
this@Stability(value=Experimental) public BundlingOptions.Builder buildArgs(Map<String,String> buildArgs)
BundlingOptions.getBuildArgs()buildArgs - Build arguments to pass when building the bundling image.this@Stability(value=Experimental) public BundlingOptions.Builder cgoEnabled(Boolean cgoEnabled)
BundlingOptions.getCgoEnabled()cgoEnabled - Whether or not to enable cgo during go build.
This will set the CGO_ENABLED environment variablethis@Stability(value=Experimental) public BundlingOptions.Builder commandHooks(ICommandHooks commandHooks)
BundlingOptions.getCommandHooks()commandHooks - Command hooks.this@Stability(value=Experimental) public BundlingOptions.Builder dockerImage(DockerImage dockerImage)
BundlingOptions.getDockerImage()dockerImage - A custom bundling Docker image.this@Stability(value=Experimental) public BundlingOptions.Builder environment(Map<String,String> environment)
BundlingOptions.getEnvironment()environment - Environment variables defined when go runs.this@Stability(value=Experimental) public BundlingOptions.Builder forcedDockerBundling(Boolean forcedDockerBundling)
BundlingOptions.getForcedDockerBundling()forcedDockerBundling - Force bundling in a Docker container even if local bundling is possible.this@Stability(value=Experimental) public BundlingOptions.Builder goBuildFlags(List<String> goBuildFlags)
BundlingOptions.getGoBuildFlags()goBuildFlags - List of additional flags to use while building.
For example:
['ldflags "-s -w"']this@Stability(value=Experimental) public BundlingOptions build()
build in interface software.amazon.jsii.Builder<BundlingOptions>BundlingOptionsNullPointerException - if any required attribute was not providedCopyright © 2021. All rights reserved.