Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildEnv ¶
BuildEnv returns the environment for the cdk subprocess: base with ambient AWS configuration stripped and the LocalStack-pointing values set (overriding any pre-existing entries). Empty endpoint values are not set, so they never clobber a meaningful inherited value with "".
AWS_ACCESS_KEY_ID is fixed to the mock value "test" (never an account id), so CDK always resolves the default LocalStack account 000000000000. This unconditionally overrides any ambient AWS_ACCESS_KEY_ID — including a 12-digit value that LocalStack would otherwise treat as a custom account.
func CheckVersion ¶
CheckVersion runs `<cdkBin> --version` and returns an error if the reported version is below the minimum lstk supports, or if the output cannot be parsed. lstk points CDK at LocalStack purely through environment variables, which only CDK >= minCDKVersionString honors; on an older (or unparseable) version lstk must refuse to run so it cannot silently target real AWS.
func IsHelp ¶ added in v0.18.0
IsHelp reports whether args requests cdk's help output. cdk answers this without needing a running emulator, same as the other offline commands.
func IsOffline ¶
IsOffline reports whether the CDK invocation described by args is one of the offline subcommands that need no running emulator, or a help request.
func Run ¶
func Run(ctx context.Context, endpointURL, region string, sink output.Sink, logger log.Logger, args []string) error
Run proxies an AWS CDK invocation against LocalStack. It locates the cdk binary, verifies its version, builds a subprocess environment that points CDK at the resolved LocalStack endpoint (and strips ambient AWS config that could redirect it at real AWS), then runs cdk with stdio wired through.
endpointURL is the resolved LocalStack endpoint (http://host:port). region is encoded into the subprocess environment as AWS_REGION. CDK has no account selection: it always targets the default LocalStack account via a fixed mock AWS_ACCESS_KEY_ID. CDK output is streamed unobstructed (no spinner); a non-zero exit is wrapped as a silent error so lstk does not reprint it.
Types ¶
This section is empty.