Class ServiceCatalogDeployer

java.lang.Object
com.cloudforgeci.api.deploy.catalog.ServiceCatalogDeployer
All Implemented Interfaces:
AutoCloseable

public final class ServiceCatalogDeployer extends Object implements AutoCloseable
Provisions/terminates AWS Service Catalog products — the deploy:catalog path (backing the SC_PROVISION capability). Deliberately simpler than AwsDirectDeployer: no CDK synthesis, no template of any kind travels through this class — the product's publisher already registered a provisioning artifact (a CloudFormation template) with Service Catalog, so this only ever calls ProvisionProduct/TerminateProvisionedProduct with parameters, then polls DescribeRecord until Service Catalog's own provisioning engine (which itself just runs a CloudFormation stack update behind the scenes, on a launch- constraint role that is not Manager's) reaches a terminal state — same "poll until terminal" shape AwsDirectDeployer's change-set wait already uses, just against a different AWS API with no built-in SDK waiter to reuse.

Idempotency is native here, unlike the CFN path: ProvisionProductRequest .provisionToken()/TerminateProvisionedProductRequest.terminateToken() are real AWS API idempotency tokens — passing the same token for a retried call returns the same record instead of provisioning twice. Callers should still pass a real token (this class doesn't generate one itself) so that guarantee actually applies.

update only supports explicit new parameter values, not Service Catalog's UpdateProvisioningParameter.usePreviousValue — see UpdateProvisionedProductInput's javadoc for what that means for parameters an update call omits.

Targets real AWS by default, but redirects to a local emulator when this Manager instance is itself running inside one — same LOCALSTACK_ENDPOINT/AWS_ENDPOINT_URL detection AwsDirectDeployer uses, mirrored here for the same reason: this class originally always used the default credential chain with no endpoint override, which would have hit the exact same "calls real AWS from inside LocalStack" bug AwsDirectDeployer was caught doing, the moment Service Catalog is ever exposed by a local emulator this deploys against (it isn't yet on this repo's LocalStack setup — see the plan's 2026-08-11 note — so this specific redirect is currently unexercised, but is not silently wrong the day that changes).

  • Constructor Details

    • ServiceCatalogDeployer

      public ServiceCatalogDeployer(String region)
      Defaults target to DeploymentTarget.AWS — this constructor predates a target parameter existing at all, and every caller today is a real-AWS Service Catalog operation; prefer the 2-arg overload for any new caller so the target is explicit rather than assumed.
    • ServiceCatalogDeployer

      public ServiceCatalogDeployer(String region, DeploymentTarget target)
      Real AWS by default; redirects to a local emulator instead when target resolves to one via ManagerEndpointSupport.resolveLocalEmulatorEndpoint(DeploymentTarget) — see class javadoc. target must be the caller's own already-known, validated target (never re-derived from env vars here — see that method's own javadoc for why).
  • Method Details