Experimental
@aws-cdk/aws-amplify-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
AppProps Struct
Properties for an App.
Example
const amplifyApp = new amplify.App(this, 'MyApp', {
sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
owner: '<user>',
repository: '<repo>',
oauthToken: SecretValue.secretsManager('my-github-token'),
}),
autoBranchCreation: { // Automatically connect branches that match a pattern set
patterns: ['feature/*', 'test/*'],
},
autoBranchDeletion: true, // Automatically disconnect a branch when you delete a branch from your repository
});
amplify_app = amplify.App(self, "MyApp",
source_code_provider=amplify.GitHubSourceCodeProvider(
owner="<user>",
repository="<repo>",
oauth_token=SecretValue.secrets_manager("my-github-token")
),
auto_branch_creation=amplify.AutoBranchCreation( # Automatically connect branches that match a pattern set
patterns=["feature/*", "test/*"]),
auto_branch_deletion=True
)
App amplifyApp = App.Builder.create(this, "MyApp")
.sourceCodeProvider(GitHubSourceCodeProvider.Builder.create()
.owner("<user>")
.repository("<repo>")
.oauthToken(SecretValue.secretsManager("my-github-token"))
.build())
.autoBranchCreation(AutoBranchCreation.builder() // Automatically connect branches that match a pattern set
.patterns(List.of("feature/*", "test/*")).build())
.autoBranchDeletion(true)
.build();
// Install: dotnet add package Amazon.CDK.AWS.Amplify.Alpha
var amplifyApp = new App(this, "MyApp", new AppProps {
SourceCodeProvider = new GitHubSourceCodeProvider(new GitHubSourceCodeProviderProps {
Owner = "<user>",
Repository = "<repo>",
OauthToken = SecretValue.SecretsManager("my-github-token")
}),
AutoBranchCreation = new AutoBranchCreation { // Automatically connect branches that match a pattern set
Patterns = new [] { "feature/*", "test/*" } },
AutoBranchDeletion = true
});
// Install: go get github.com/aws/aws-cdk-go/awscdkamplifyalpha/v2
amplifyApp := amplify.NewApp(this, jsii.String("MyApp"), &AppProps{
SourceCodeProvider: amplify.NewGitHubSourceCodeProvider(&GitHubSourceCodeProviderProps{
Owner: jsii.String("<user>"),
Repository: jsii.String("<repo>"),
OauthToken: awscdk.SecretValue_SecretsManager(jsii.String("my-github-token")),
}),
AutoBranchCreation: &AutoBranchCreation{
// Automatically connect branches that match a pattern set
Patterns: []*string{
jsii.String("feature/*"),
jsii.String("test/*"),
},
},
AutoBranchDeletion: jsii.Boolean(true),
})
Properties
appNameoptionalstringapp_nameoptionalstrappNameoptionalStringAppNameoptionalstringAppNameoptional*string#Default: a CDK generated name
autoBranchCreationoptionalAutoBranchCreationauto_branch_creationoptionalAutoBranchCreationautoBranchCreationoptionalAutoBranchCreationAutoBranchCreationoptionalAutoBranchCreationAutoBranchCreationoptionalAutoBranchCreation#Default: no auto branch creation
Use this to automatically create branches that match a certain pattern.
autoBranchDeletionoptionalbooleanauto_branch_deletionoptionalboolautoBranchDeletionoptionalBooleanAutoBranchDeletionoptionalboolAutoBranchDeletionoptional*bool= false#basicAuthoptionalBasicAuthbasic_authoptionalBasicAuthbasicAuthoptionalBasicAuthBasicAuthoptionalBasicAuthBasicAuthoptionalBasicAuth#Default: no password protection
Use this to set password protection at an app level to all your branches.
buildComputeTypeoptionalBuildComputeTypebuild_compute_typeoptionalBuildComputeTypebuildComputeTypeoptionalBuildComputeTypeBuildComputeTypeoptionalBuildComputeTypeBuildComputeTypeoptionalBuildComputeType#Default: undefined - Amplify default setting is BuildComputeType.STANDARD_8GB.
buildSpecoptionalBuildSpecbuild_specoptionalBuildSpecbuildSpecoptionalBuildSpecBuildSpecoptionalBuildSpecBuildSpecoptionalBuildSpec#Default: no build spec
Alternatively, add a amplify.yml file to the repository.
cacheConfigTypeoptionalCacheConfigTypecache_config_typeoptionalCacheConfigTypecacheConfigTypeoptionalCacheConfigTypeCacheConfigTypeoptionalCacheConfigTypeCacheConfigTypeoptionalCacheConfigType= CacheConfigType.AMPLIFY_MANAGED#computeRoleoptionalIRolecompute_roleoptionalIRolecomputeRoleoptionalIRoleComputeRoleoptionalIRoleComputeRoleoptionalIRole#Default: undefined - a new role is created when platform is Platform.WEB_COMPUTE or Platform.WEB_DYNAMIC, otherwise no compute role
The Compute role allows the Amplify Hosting compute service to securely access specific AWS resources based on the role's permissions.
customResponseHeadersoptionalCustomResponseHeader[]custom_response_headersoptionaltyping.List[CustomResponseHeader]customResponseHeadersoptionalList<CustomResponseHeader>CustomResponseHeadersoptionalCustomResponseHeader[]CustomResponseHeadersoptional*[]CustomResponseHeader#Default: no custom response headers
customRulesoptionalCustomRule[]custom_rulesoptionaltyping.List[CustomRule]customRulesoptionalList<CustomRule>CustomRulesoptionalCustomRule[]CustomRulesoptional*[]CustomRule#Default: no custom rewrite/redirect rules
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string#Default: no description
environmentVariablesoptional{ [key: string]: string }environment_variablesoptionaltyping.Mapping[str, str]environmentVariablesoptionalMap<String, String>EnvironmentVariablesoptionalIDictionary<string, string>EnvironmentVariablesoptional*map[string]*string#Default: no environment variables
All environment variables that you add are encrypted to prevent rogue access so you can use them to store secret information.
platformoptionalPlatformplatformoptionalPlatformplatformoptionalPlatformPlatformoptionalPlatformPlatformoptionalPlatform= Platform.WEB#Set to WEB for static site generated (SSG) apps (i.e. a Create React App or Gatsby) and WEB_COMPUTE for server side rendered (SSR) apps (i.e. NextJS).
Default: a new role is created
The App implements IGrantable.
sourceCodeProvideroptionalISourceCodeProvidersource_code_provideroptionalISourceCodeProvidersourceCodeProvideroptionalISourceCodeProviderSourceCodeProvideroptionalISourceCodeProviderSourceCodeProvideroptionalISourceCodeProvider#Default: not connected to a source code provider