Class LocalStackDeployer
java.lang.Object
com.cloudforgeci.localstack.LocalStackDeployer
- All Implemented Interfaces:
LocalDeployer, AutoCloseable
Creates and incrementally updates CloudFormation stacks against LocalStack.
All calls use the configured local endpoint; no host AWS CLI or AWS account is used.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordDeprecated.static final recordDeprecated.useLocalDeployResult. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDisable same-app stack replacement when set tofalseor0. -
Constructor Summary
ConstructorsConstructorDescriptionLocalStackDeployer(String endpoint, String region) Visible for tests and custom endpoint wiring. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidActive*-localstackstacks (excludes DELETE*).replaceSameApplicationStacks(String applicationId, String keepCfnStack, Path catalogDirectory) When replacing an app under a new stack name, delete other active LocalStack stacks for the sameapplicationId(tag ordeployment-contextscatalog).static StringLocalStack gateway URL fromLOCALSTACK_ENDPOINT, thenAWS_ENDPOINT_URL, defaulting tohttp://localhost:4566.booleanstackExists(String stackName) Read stack tags; empty when stack missing or has none.verifyDeployment(String stackName) Confirm the stack exists and return its outputs.
-
Field Details
-
REPLACE_SAME_APP_ENV
Disable same-app stack replacement when set tofalseor0.- See Also:
-
-
Constructor Details
-
LocalStackDeployer
public LocalStackDeployer() -
LocalStackDeployer
-
-
Method Details
-
resolveEndpoint
LocalStack gateway URL fromLOCALSTACK_ENDPOINT, thenAWS_ENDPOINT_URL, defaulting tohttp://localhost:4566. -
deploy
- Specified by:
deployin interfaceLocalDeployer- Throws:
IOException
-
delete
- Specified by:
deletein interfaceLocalDeployer- Throws:
IOException
-
listActiveLocalstackStacks
-
stackTags
-
replaceSameApplicationStacks
public LocalSameApplicationStackReplacer.Result replaceSameApplicationStacks(String applicationId, String keepCfnStack, Path catalogDirectory) When replacing an app under a new stack name, delete other active LocalStack stacks for the sameapplicationId(tag ordeployment-contextscatalog). -
verifyDeployment
Confirm the stack exists and return its outputs.- Throws:
IOException- when the stack is missing or outputs cannot be read
-
stackExists
- Specified by:
stackExistsin interfaceLocalDeployer
-
outputs
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceLocalDeployer
-
LocalResourceChange.