Skip to content
v2.277.0

Experimental

@aws-cdk/app-staging-synthesizer-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

CustomFactoryOptions Struct ​

Properties for customFactory static method.

Example ​

ts
class CustomFactory implements IStagingResourcesFactory {
  public obtainStagingResources(stack: Stack, context: ObtainStagingResourcesContext) {
    const myApp = App.of(stack);

    return new CustomStagingStack(myApp!, `CustomStagingStack-${context.environmentString}`, {});
  }
}

const app = new App({
  defaultStackSynthesizer: AppStagingSynthesizer.customFactory({
    factory: new CustomFactory(),
    oncePerEnv: true, // by default
  }),
});
python
@jsii.implements(IStagingResourcesFactory)
class CustomFactory:
    def obtain_staging_resources(self, stack, *, environmentString, deployRoleArn=None, qualifier):
        my_app = App.of(stack)

        return CustomStagingStack(my_app, f"CustomStagingStack-{context.environmentString}")

app = App(
    default_stack_synthesizer=AppStagingSynthesizer.custom_factory(
        factory=CustomFactory(),
        once_per_env=True
    )
)
java
public class CustomFactory implements IStagingResourcesFactory {
    public CustomStagingStack obtainStagingResources(Stack stack, ObtainStagingResourcesContext context) {
        Stage myApp = App.of(stack);

        return new CustomStagingStack(myApp, String.format("CustomStagingStack-%s", context.getEnvironmentString()), new CustomStagingStackProps());
    }
}

App app = App.Builder.create()
        .defaultStackSynthesizer(AppStagingSynthesizer.customFactory(CustomFactoryOptions.builder()
                .factory(new CustomFactory())
                .oncePerEnv(true)
                .build()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AppStagingSynthesizer.Alpha
class CustomFactory : IStagingResourcesFactory
{
    public CustomStagingStack ObtainStagingResources(Stack stack, ObtainStagingResourcesContext context)
    {
        var myApp = App.Of(stack);

        return new CustomStagingStack(myApp, $"CustomStagingStack-{context.environmentString}", new CustomStagingStackProps { });
    }
}

var app = new App(new AppProps {
    DefaultStackSynthesizer = AppStagingSynthesizer.CustomFactory(new CustomFactoryOptions {
        Factory = new CustomFactory(),
        OncePerEnv = true
    })
});
go
// Install: go get github.com/aws/aws-cdk-go/appstagingsynthesizeralpha/v2
type customFactory struct {
}

func (this *customFactory) obtainStagingResources(stack Stack, context ObtainStagingResourcesContext) customStagingStack {
	myApp := awscdk.App_Of(*stack)

	return newCustomStagingStack(myApp, fmt.Sprintf("CustomStagingStack-%v", *context.EnvironmentString), &customStagingStackProps{
	})
}

app := awscdk.NewApp(&AppProps{
	DefaultStackSynthesizer: appstagingsynthesizeralpha.AppStagingSynthesizer_CustomFactory(&CustomFactoryOptions{
		Factory: newCustomFactory(),
		OncePerEnv: jsii.Boolean(true),
	}),
})

Properties ​

bootstrapQualifieroptionalstringbootstrap_qualifieroptionalstrbootstrapQualifieroptionalStringBootstrapQualifieroptionalstringBootstrapQualifieroptional*string#
Qualifier to disambiguate multiple bootstrapped environments in the same account.

Default: Value of context key '@aws-cdk/core:bootstrapQualifier' if set, otherwise DEFAULT_QUALIFIER

This qualifier is only used to reference bootstrapped resources. It will not be used in the creation of app-specific staging resources: appId is used for that instead.

deploymentIdentitiesoptionalDeploymentIdentitiesdeployment_identitiesoptionalDeploymentIdentitiesdeploymentIdentitiesoptionalDeploymentIdentitiesDeploymentIdentitiesoptionalDeploymentIdentitiesDeploymentIdentitiesoptionalDeploymentIdentities#
What roles to use to deploy applications.

Default: The standard bootstrapped CDK roles

These are the roles that have permissions to interact with CloudFormation on your behalf. By default these are the standard bootstrapped CDK roles, but you can customize them or turn them off and use the CLI credentials to deploy.

The factory that will be used to return staging resources for each stack.
oncePerEnvoptionalbooleanonce_per_envoptionalbooloncePerEnvoptionalBooleanOncePerEnvoptionalboolOncePerEnvoptional*bool= true#
Reuse the answer from the factory for stacks in the same environment.