HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //snap/google-cloud-cli/current/help/man/man1/gcloud_infra-manager_deployments_apply.1
.TH "GCLOUD_INFRA\-MANAGER_DEPLOYMENTS_APPLY" 1



.SH "NAME"
.HP
gcloud infra\-manager deployments apply \- create or update a deployment



.SH "SYNOPSIS"
.HP
\f5gcloud infra\-manager deployments apply\fR (\fIDEPLOYMENT\fR\ :\ \fB\-\-location\fR=\fILOCATION\fR) [\fB\-\-annotations\fR=[\fIKEY\fR=\fIVALUE\fR,...]] [\fB\-\-artifacts\-gcs\-bucket\fR=\fIARTIFACTS_GCS_BUCKET\fR] [\fB\-\-async\fR] [\fB\-\-import\-existing\-resources\fR] [\fB\-\-labels\fR=[\fIKEY\fR=\fIVALUE\fR,...]] [\fB\-\-quota\-validation\fR=\fIQUOTA_VALIDATION\fR] [\fB\-\-service\-account\fR=\fISERVICE_ACCOUNT\fR] [\fB\-\-tf\-version\-constraint\fR=\fITF_VERSION_CONSTRAINT\fR] [\fB\-\-worker\-pool\fR=\fIWORKER_POOL\fR] [\fB\-\-gcs\-source\fR=\fIGCS_SOURCE\fR\ |\ \fB\-\-git\-source\-directory\fR=\fIGIT_SOURCE_DIRECTORY\fR\ \fB\-\-git\-source\-ref\fR=\fIGIT_SOURCE_REF\fR\ \fB\-\-git\-source\-repo\fR=\fIGIT_SOURCE_REPO\fR\ |\ \fB\-\-ignore\-file\fR=\fIIGNORE_FILE\fR\ \fB\-\-local\-source\fR=\fILOCAL_SOURCE\fR\ \fB\-\-input\-values\fR=[\fIKEY\fR=\fIVALUE\fR,...]\ |\ \fB\-\-inputs\-file\fR=\fIINPUTS_FILE\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]



.SH "DESCRIPTION"

This command updates a deployment when it already exists, otherwise the
deployment will be created.



.SH "EXAMPLES"

Create a deployment named \f5my\-deployment\fR from a storage \f5my\-bucket\fR:

.RS 2m
$ gcloud infra\-manager deployments apply \e
    projects/p1/locations/us\-central1/deployments/my\-deployment \e
    \-\-gcs\-source="gs://my\-bucket" \e
    \-\-input\-values="project=p1,region=us\-central1"
.RE

Create a deployment named \f5my\-deployment\fR from git repo
"https://github.com/examples/repository.git", "staging/compute" folder,
"mainline" branch:

.RS 2m
$ gcloud infra\-manager deployments apply \e
    projects/p1/locations/us\-central1/deployments/my\-deployment \e
    \-\-git\-source\-repo="https://github.com/examples/repository.git" \e
    \-\-git\-source\-directory="staging/compute" \e
    \-\-git\-source\-ref="mainline"
.RE

Update a deployment's labels:

.RS 2m
$ gcloud infra\-manager deployments apply \e
    projects/p1/locations/us\-central1/deployments/my\-deployment \e
    \-\-git\-source\-repo="https://github.com/examples/repository.git" \e
    \-\-git\-source\-directory="staging/compute" \e
    \-\-git\-source\-ref="mainline" \-\-labels="env=prod,team=finance"
.RE



.SH "POSITIONAL ARGUMENTS"

.RS 2m
.TP 2m

Deployment resource \- the deployment to create or update. The arguments in this
group can be used to specify the attributes of this resource. (NOTE) Some
attributes are not given arguments in this group but can be set in other ways.

To set the \f5project\fR attribute:
.RS 2m
.IP "\(em" 2m
provide the argument \f5DEPLOYMENT\fR on the command line with a fully specified
name;
.IP "\(em" 2m
provide the argument \f5\-\-project\fR on the command line;
.IP "\(em" 2m
set the property \f5core/project\fR.
.RE
.sp

This must be specified.


.RS 2m
.TP 2m
\fIDEPLOYMENT\fR

ID of the deployment or fully qualified identifier for the deployment.

To set the \f5deployment\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5DEPLOYMENT\fR on the command line.
.RE
.sp

This positional argument must be specified if any of the other arguments in this
group are specified.

.TP 2m
\fB\-\-location\fR=\fILOCATION\fR

The Cloud location for the deployment.

To set the \f5location\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5DEPLOYMENT\fR on the command line with a fully specified
name;
.IP "\(bu" 2m
provide the argument \f5\-\-location\fR on the command line;
.IP "\(bu" 2m
set the property \f5infra\-manager/location\fR.
.RE
.sp


.RE
.RE
.sp

.SH "FLAGS"

.RS 2m
.TP 2m
\fB\-\-annotations\fR=[\fIKEY\fR=\fIVALUE\fR,...]

Annotations to apply to the deployment. Existing values are overwritten. To
retain the existing annotations on a deployment, do not specify this flag.

Examples:

Update annotations for an existing deployment:

.RS 2m
$ gcloud infra\-manager deployments apply \e
    projects/p1/locations/us\-central1/deployments/my\-deployment \e
    \-\-gcs\-source="gs://my\-bucket" \e
    \-\-annotations="env=prod,team=finance"
.RE

Clear annotations for an existing deployment:

.RS 2m
$ gcloud infra\-manager deployments apply \e
    projects/p1/locations/us\-central1/deployments/my\-deployment \e
    \-\-gcs\-source="gs://my\-bucket" \-\-annotations=""
.RE

Add an annotation to an existing deployment:

.RS 2m
First, fetch the current annotations using the `describe` command, then follow the
preceding example for updating annotations.
.RE

.TP 2m
\fB\-\-artifacts\-gcs\-bucket\fR=\fIARTIFACTS_GCS_BUCKET\fR

user\-defined location of Cloud Build logs, artifacts, and Terraform state files
in Google Cloud Storage. Format: \f5gs://{bucket}/{folder}\fR A default bucket
will be bootstrapped if the field is not set or empty

.TP 2m
\fB\-\-async\fR

Return immediately, without waiting for the operation in progress to complete.

.TP 2m
\fB\-\-import\-existing\-resources\fR

By default, Infrastructure Manager will return a failure when Terraform
encounters a 409 code (resource conflict error) during actuation. If this flag
is set to true, Infrastructure Manager will instead attempt to automatically
import the resource into the Terraform state (for supported resource types) and
continue actuation.

.TP 2m
\fB\-\-labels\fR=[\fIKEY\fR=\fIVALUE\fR,...]

Labels to apply to the deployment. Existing values are overwritten. To retain
the existing labels on a deployment, do not specify this flag.

Examples:

Update labels for an existing deployment:

.RS 2m
$ gcloud infra\-manager deployments apply \e
    projects/p1/locations/us\-central1/deployments/my\-deployment \e
    \-\-gcs\-source="gs://my\-bucket" \-\-labels="env=prod,team=finance"
.RE

Clear labels for an existing deployment:

.RS 2m
$ gcloud infra\-manager deployments apply \e
    projects/p1/locations/us\-central1/deployments/my\-deployment \e
    \-\-gcs\-source="gs://my\-bucket" \-\-labels=""
.RE

Add a label to an existing deployment:

.RS 2m
First, fetch the current labels using the `describe` command, then follow the
preceding example for updating labels.
.RE

.TP 2m
\fB\-\-quota\-validation\fR=\fIQUOTA_VALIDATION\fR

Input to control quota checks for resources in terraform configuration files.
There are limited resources on which quota validation applies. Supported values
are QUOTA_VALIDATION_UNSPECIFIED, ENABLED, ENFORCED

.TP 2m
\fB\-\-service\-account\fR=\fISERVICE_ACCOUNT\fR

User\-specified Service Account (SA) to be used as credential to manage
resources. Format: \f5projects/{projectID}/serviceAccounts/{serviceAccount}\fR

.TP 2m
\fB\-\-tf\-version\-constraint\fR=\fITF_VERSION_CONSTRAINT\fR

User\-specified Terraform version constraint, for example "=1.3.10".

.TP 2m
\fB\-\-worker\-pool\fR=\fIWORKER_POOL\fR

User\-specified Worker Pool resource in which the Cloud Build job will execute.
Format: projects/{project}/locations/{location}/workerPools/{workerPoolId}

.TP 2m

At most one of these can be specified:


.RS 2m
.TP 2m
\fB\-\-gcs\-source\fR=\fIGCS_SOURCE\fR

URI of an object in Google Cloud Storage. e.g. \f5gs://{bucket}/{object}\fR

Examples:

Create a deployment from a storage my\-bucket:

.RS 2m
$ gcloud infra\-manager deployments apply \e
    projects/p1/location/us\-central1/deployments/my\-deployment \e
    \-\-gcs\-source="gs://my\-bucket"
.RE

.TP 2m
\fB\-\-git\-source\-directory\fR=\fIGIT_SOURCE_DIRECTORY\fR

Subdirectory inside the repository. Example: 'staging/my\-package'

Use in conjunction with \f5\-\-git\-source\-repo\fR and
\f5\-\-git\-source\-ref\fR

Examples:

Create a deployment from the "https://github.com/examples/repository.git" repo,
"staging/compute" folder, "mainline" branch:

.RS 2m
$ gcloud infra\-manager deployments apply \e
    projects/p1/location/us\-central1/deployments/my\-deployment \e
    \-\-git\-source\-repo="https://github.com/examples/repository.git"
  \-\-git\-source\-directory="staging/compute" \-\-git\-source\-ref="mainline"
.RE

.TP 2m
\fB\-\-git\-source\-ref\fR=\fIGIT_SOURCE_REF\fR

Subdirectory inside the repository. Example: 'staging/my\-package'

Use in conjunction with \f5\-\-git\-source\-repo\fR and
\f5\-\-git\-source\-directory\fR

Examples:

Create a deployment from the "https://github.com/examples/repository.git" repo,
"staging/compute" folder, "mainline" branch:

.RS 2m
$ gcloud infra\-manager deployments apply \e
    projects/p1/location/us\-central1/deployments/my\-deployment \e
    \-\-git\-source\-repo="https://github.com/examples/repository.git"
  \-\-git\-source\-directory="staging/compute" \-\-git\-source\-ref="mainline"
.RE

.TP 2m
\fB\-\-git\-source\-repo\fR=\fIGIT_SOURCE_REPO\fR

Repository URL. Example: 'https://github.com/examples/repository.git'

Use in conjunction with \f5\-\-git\-source\-directory\fR and
\f5\-\-git\-source_ref\fR

Examples:

Create a deployment from the "https://github.com/examples/repository.git" repo,
"staging/compute" folder, "mainline" branch:

.RS 2m
$ gcloud infra\-manager deployments apply \e
    projects/p1/location/us\-central1/deployments/my\-deployment \e
    \-\-git\-source\-repo="https://github.com/examples/repository.git"
  \-\-git\-source\-directory="staging/compute" \-\-git\-source\-ref="mainline"
.RE

.TP 2m
\fB\-\-ignore\-file\fR=\fIIGNORE_FILE\fR

Override the \f5.gcloudignore\fR file and use the specified file instead. See
\f5gcloud topic gcloudignore\fR for more information.

.TP 2m
\fB\-\-local\-source\fR=\fILOCAL_SOURCE\fR

Local storage path where config files are stored. When using this option,
Terraform config file references outside this storage path is not supported.
e.g. \f5./path/to/blueprint\fR

Examples:

Create a deployment from a local storage path \f5./path/to/blueprint\fR:

.RS 2m
$ gcloud infra\-manager deployments apply \e
    projects/p1/location/us\-central1/deployments/my\-deployment \e
    \-\-local\-source="./path/to/blueprint"
.RE

.RE
.sp
.TP 2m

At most one of these can be specified:


.RS 2m
.TP 2m
\fB\-\-input\-values\fR=[\fIKEY\fR=\fIVALUE\fR,...]

Input variable values for the Terraform blueprint. It only accepts (key, value)
pairs where value is a scalar value.

Examples:

Pass input values on command line:

.RS 2m
$ gcloud infra\-manager deployments apply \e
    projects/p1/location/us\-central1/deployments/my\-deployment \e
    \-\-gcs\-source="gs://my\-bucket" \e
    \-\-input\-values=projects=p1,region=r
.RE

.TP 2m
\fB\-\-inputs\-file\fR=\fIINPUTS_FILE\fR

A .tfvars file containing terraform variable values. \-\-inputs\-file flag is
supported for python version 3.6 and above.

Examples:

Pass input values on the command line:

.RS 2m
$ gcloud infra\-manager deployments apply \e
    projects/p1/location/us\-central1/deployments/my\-deployment \e
    \-\-gcs\-source="gs://my\-bucket" \e
    \-\-inputs\-file=path\-to\-tfvar\-file.tfvar
.RE


.RE
.RE
.sp

.SH "GCLOUD WIDE FLAGS"

These flags are available to all commands: \-\-access\-token\-file, \-\-account,
\-\-billing\-project, \-\-configuration, \-\-flags\-file, \-\-flatten,
\-\-format, \-\-help, \-\-impersonate\-service\-account, \-\-log\-http,
\-\-project, \-\-quiet, \-\-trace\-token, \-\-user\-output\-enabled,
\-\-verbosity.

Run \fB$ gcloud help\fR for details.