create_app
¶
create_app(
name: Name,
*,
config_overrides: Optional[AmplifyClientConfig] = None,
description: Optional[Description] = None,
repository: Optional[Repository] = None,
platform: Optional[Platform] = None,
compute_role_arn: Optional[ComputeRoleArn] = None,
iam_service_role_arn: Optional[ServiceRoleArn] = None,
oauth_token: Optional[OauthToken] = None,
access_token: Optional[AccessToken] = None,
environment_variables: Optional[EnvironmentVariables] = None,
enable_branch_auto_build: Optional[EnableBranchAutoBuild] = None,
enable_branch_auto_deletion: Optional[EnableBranchAutoDeletion] = None,
enable_basic_auth: Optional[EnableBasicAuth] = None,
basic_auth_credentials: Optional[BasicAuthCredentials] = None,
custom_rules: Optional[CustomRules] = None,
tags: Optional[TagMap] = None,
build_spec: Optional[BuildSpec] = None,
custom_headers: Optional[CustomHeaders] = None,
enable_auto_branch_creation: Optional[EnableAutoBranchCreation] = None,
auto_branch_creation_patterns: Optional[AutoBranchCreationPatterns] = None,
auto_branch_creation_config: Optional[AutoBranchCreationConfig] = None,
job_config: Optional[JobConfig] = None,
cache_config: Optional[CacheConfig] = None,
) -> CreateAppResult
Creates a new Amplify app.
Parameters:
-
name(Name) –The name of the Amplify app.
-
description(Optional[Description], default:None) –The description of the Amplify app.
-
repository(Optional[Repository], default:None) –The Git repository for the Amplify app.
-
platform(Optional[Platform], default:None) –The platform for the Amplify app. For a static app, set the platform type to
WEB. For a dynamic server-side rendered (SSR) app, set the platform type toWEB_COMPUTE. For an app requiring Amplify Hosting's original SSR support only, set the platform type toWEB_DYNAMIC.If you are deploying an SSG only app with Next.js version 14 or later, you must set the platform type to
WEB_COMPUTEand set the artifactsbaseDirectoryto.nextin the application's build settings. For an example of the build specification settings, see Amplify build settings for a Next.js 14 SSG application in the Amplify Hosting User Guide. -
compute_role_arn(Optional[ComputeRoleArn], default:None) –The Amazon Resource Name (ARN) of the IAM role to assign to an SSR app. The SSR Compute role allows the Amplify Hosting compute service to securely access specific Amazon Web Services resources based on the role's permissions. For more information about the SSR Compute role, see Adding an SSR Compute role in the Amplify User Guide.
-
iam_service_role_arn(Optional[ServiceRoleArn], default:None) –The Amazon Resource Name (ARN) of the IAM service role for the Amplify app.
-
oauth_token(Optional[OauthToken], default:None) –The OAuth token for a third-party source control system for an Amplify app. The OAuth token is used to create a webhook and a read-only deploy key using SSH cloning. The OAuth token is not stored.
Use
oauthTokenfor repository providers other than GitHub, such as Bitbucket or CodeCommit. To authorize access to GitHub as your repository provider, useaccessToken.You must specify either
oauthTokenoraccessTokenwhen you create a new app.Existing Amplify apps deployed from a GitHub repository using OAuth continue to work with CI/CD. However, we strongly recommend that you migrate these apps to use the GitHub App. For more information, see Migrating an existing OAuth app to the Amplify GitHub App in the Amplify User Guide .
-
access_token(Optional[AccessToken], default:None) –The personal access token for a GitHub repository for an Amplify app. The personal access token is used to authorize access to a GitHub repository using the Amplify GitHub App. The token is not stored.
Use
accessTokenfor GitHub repositories only. To authorize access to a repository provider such as Bitbucket or CodeCommit, useoauthToken.You must specify either
accessTokenoroauthTokenwhen you create a new app.Existing Amplify apps deployed from a GitHub repository using OAuth continue to work with CI/CD. However, we strongly recommend that you migrate these apps to use the GitHub App. For more information, see Migrating an existing OAuth app to the Amplify GitHub App in the Amplify User Guide .
-
environment_variables(Optional[EnvironmentVariables], default:None) –The environment variables map for an Amplify app.
For a list of the environment variables that are accessible to Amplify by default, see Amplify Environment variables in the Amplify Hosting User Guide.
-
enable_branch_auto_build(Optional[EnableBranchAutoBuild], default:None) –Enables the auto building of branches for an Amplify app.
-
enable_branch_auto_deletion(Optional[EnableBranchAutoDeletion], default:None) –Automatically disconnects a branch in the Amplify console when you delete a branch from your Git repository.
-
enable_basic_auth(Optional[EnableBasicAuth], default:None) –Enables basic authorization for an Amplify app. This will apply to all branches that are part of this app.
-
basic_auth_credentials(Optional[BasicAuthCredentials], default:None) –The credentials for basic authorization for an Amplify app. You must base64-encode the authorization credentials and provide them in the format
user:password. -
custom_rules(Optional[CustomRules], default:None) –The custom rewrite and redirect rules for an Amplify app.
-
tags(Optional[TagMap], default:None) –The tag for an Amplify app.
-
build_spec(Optional[BuildSpec], default:None) –The build specification (build spec) for an Amplify app.
-
custom_headers(Optional[CustomHeaders], default:None) –The custom HTTP headers for an Amplify app.
-
enable_auto_branch_creation(Optional[EnableAutoBranchCreation], default:None) –Enables automated branch creation for an Amplify app.
-
auto_branch_creation_patterns(Optional[AutoBranchCreationPatterns], default:None) –The automated branch creation glob patterns for an Amplify app.
-
auto_branch_creation_config(Optional[AutoBranchCreationConfig], default:None) –The automated branch creation configuration for an Amplify app.
-
job_config(Optional[JobConfig], default:None) –Describes the configuration details that apply to the jobs for an Amplify app.
-
cache_config(Optional[CacheConfig], default:None) –The cache configuration for the Amplify app.
Raises:
-
BadRequestException–A request contains unexpected data.
-
DependentServiceFailureException–An operation failed because a dependent service threw an exception.
-
InternalFailureException–The service failed to perform an operation due to an internal issue.
-
LimitExceededException–A resource could not be created because service quotas were exceeded.
-
UnauthorizedException–An operation failed due to a lack of access.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_amplify/_services/amplify.py
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 | |