This is the new Amazon CloudFormation Template Reference Guide. Please update your bookmarks and links. For help getting started with CloudFormation, see the Amazon CloudFormation User Guide.
AWS::AmplifyGen3::App
The AWS::AmplifyGen3::App resource specifies an Amazon Amplify Gen 3 app. An app connects to a source repository and always has two environments, a production environment and a preview environment, which you configure with the ProductionEnvironment and PreviewEnvironment properties.
To add more environments to an app, use the AWS::AmplifyGen3::Environment resource.
Syntax
To declare this entity in your Amazon CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::AmplifyGen3::App", "Properties" : { "AppName" :String, "Backend" :AppBackend, "PreviewEnvironment" :PrescribedEnvironment, "ProductionEnvironment" :PrescribedEnvironment, "SourceConfig" :AppSourceConfig, "Tags" :[ Tag, ... ], "Web" :AppWeb} }
YAML
Type: AWS::AmplifyGen3::App Properties: AppName:StringBackend:AppBackendPreviewEnvironment:PrescribedEnvironmentProductionEnvironment:PrescribedEnvironmentSourceConfig:AppSourceConfigTags:- TagWeb:AppWeb
Properties
AppName-
The name of the app.
Required: Yes
Type: String
Minimum:
1Maximum:
40Update requires: Replacement
Backend-
The backend settings for the app. An empty object adds a backend with default settings. Removing this property deletes the backend and its data.
Required: No
Type: AppBackend
Update requires: No interruption
PreviewEnvironment-
The configuration of the app's preview environment.
Required: Yes
Type: PrescribedEnvironment
Update requires: No interruption
ProductionEnvironment-
The configuration of the app's production environment.
Required: Yes
Type: PrescribedEnvironment
Update requires: No interruption
SourceConfig-
The source configuration for the app.
Required: No
Type: AppSourceConfig
Update requires: No interruption
-
An array of key-value pairs to apply to this resource.
For more information, see Tag.
Required: No
Type: Array of Tag
Update requires: No interruption
Web-
The web hosting settings for the app.
Required: No
Type: AppWeb
Update requires: No interruption
Return values
Ref
When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the ARN of the app.
For more information about using the Ref function, see Ref.
Fn::GetAtt
The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.
For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.
AppArn-
The Amazon Resource Name (ARN) of the app.
CreatedAt-
The time at which the app was created. The value is in ISO-8601 format.
PreviewEnvironment.Backend.DatabaseLogConfig.CloudWatchLogsConfig.LogGroupArn-
The ARN of the Amazon CloudWatch Logs log group that receives the environment's database logs.
PreviewEnvironment.CreatedAt-
The time at which the environment was created. The value is in ISO-8601 format.
PreviewEnvironment.EnvironmentArn-
The Amazon Resource Name (ARN) of the environment.
PreviewEnvironment.EnvironmentName-
The name of the environment.
PreviewEnvironment.Web.AccessLogConfig.CloudWatchLogsConfig.LogGroupArn-
The ARN of the Amazon CloudWatch Logs log group that receives the environment's access logs.
ProductionEnvironment.Backend.DatabaseLogConfig.CloudWatchLogsConfig.LogGroupArn-
The ARN of the Amazon CloudWatch Logs log group that receives the environment's database logs.
ProductionEnvironment.CreatedAt-
The time at which the environment was created. The value is in ISO-8601 format.
ProductionEnvironment.EnvironmentArn-
The Amazon Resource Name (ARN) of the environment.
ProductionEnvironment.EnvironmentName-
The name of the environment.
ProductionEnvironment.Web.AccessLogConfig.CloudWatchLogsConfig.LogGroupArn-
The ARN of the Amazon CloudWatch Logs log group that receives the environment's access logs.
Examples
Create an app with production and preview environments
The following example creates an app with web build settings. The production environment rolls out each deployment all at once.
JSON
{ "Resources": { "MyApp": { "Type": "AWS::AmplifyGen3::App", "Properties": { "AppName": "my-app", "Web": { "BuildConfig": { "InstallCommand": "npm ci", "BuildCommand": "npm run build", "OutputDirectory": "dist" } }, "ProductionEnvironment": { "EnvironmentRoleArn": "arn:aws:iam::123456789012:role/AmplifyGen3EnvironmentRole", "GradualRolloutConfig": { "PresetConfig": { "Preset": "ALL_AT_ONCE" } } }, "PreviewEnvironment": { "EnvironmentRoleArn": "arn:aws:iam::123456789012:role/AmplifyGen3EnvironmentRole" }, "Tags": [ { "Key": "team", "Value": "web" } ] } } } }
YAML
Resources: MyApp: Type: AWS::AmplifyGen3::App Properties: AppName: my-app Web: BuildConfig: InstallCommand: npm ci BuildCommand: npm run build OutputDirectory: dist ProductionEnvironment: EnvironmentRoleArn: arn:aws:iam::123456789012:role/AmplifyGen3EnvironmentRole GradualRolloutConfig: PresetConfig: Preset: ALL_AT_ONCE PreviewEnvironment: EnvironmentRoleArn: arn:aws:iam::123456789012:role/AmplifyGen3EnvironmentRole Tags: - Key: team Value: web