File: //snap/google-cloud-cli/current/help/man/man1/gcloud_infra-manager_previews_create.1
.TH "GCLOUD_INFRA\-MANAGER_PREVIEWS_CREATE" 1
.SH "NAME"
.HP
gcloud infra\-manager previews create \- create a preview
.SH "SYNOPSIS"
.HP
\f5gcloud infra\-manager previews create\fR [\fIPREVIEW\fR] [\fB\-\-annotations\fR=[\fIKEY\fR=\fIVALUE\fR,...]] [\fB\-\-artifacts\-gcs\-bucket\fR=\fIARTIFACTS_GCS_BUCKET\fR] [\fB\-\-async\fR] [\fB\-\-deployment\fR=\fIDEPLOYMENT\fR] [\fB\-\-labels\fR=[\fIKEY\fR=\fIVALUE\fR,...]] [\fB\-\-location\fR=\fILOCATION\fR] [\fB\-\-preview\-mode\fR=\fIPREVIEW_MODE\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 creates a preview.
.SH "EXAMPLES"
Create a preview named \f5my\-preview\fR from a storage \f5my\-bucket\fR:
.RS 2m
$ gcloud infra\-manager previews create \e
projects/p1/locations/us\-central1/previews/my\-preview \e
\-\-gcs\-source="gs://my\-bucket" \e
\-\-input\-values="project=p1,region=us\-central1"
.RE
Create a preview named \f5my\-preview\fR from git repo
"https://github.com/examples/repository.git", "staging/compute" folder,
"mainline" branch:
.RS 2m
$ gcloud infra\-manager previews create \e
projects/p1/locations/us\-central1/previews/my\-preview \e
\-\-git\-source\-repo="https://github.com/examples/repository.git" \e
\-\-git\-source\-directory="staging/compute" \e
\-\-git\-source\-ref="mainline"
.RE
.SH "POSITIONAL ARGUMENTS"
.RS 2m
.TP 2m
Preview resource \- the preview to be used as parent. It is optional and will be
generated if not specified with a fully specified name. This represents a Cloud
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 \f5PREVIEW\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
To set the \f5location\fR attribute:
.RS 2m
.IP "\(em" 2m
provide the argument \f5PREVIEW\fR on the command line with a fully specified
name;
.IP "\(em" 2m
provide the argument \f5\-\-location\fR on the command line;
.IP "\(em" 2m
set the property \f5infra\-manager/location\fR.
.RE
.sp
.RS 2m
.TP 2m
\fIPREVIEW\fR
ID of the preview or fully qualified identifier for the preview.
To set the \f5preview\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5PREVIEW\fR on the command line.
.RE
.sp
.RE
.RE
.sp
.SH "FLAGS"
.RS 2m
.TP 2m
\fB\-\-annotations\fR=[\fIKEY\fR=\fIVALUE\fR,...]
Preview annotations cannot be updated after creation.
.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\-\-deployment\fR=\fIDEPLOYMENT\fR
Deployment reference for preview.
.TP 2m
\fB\-\-labels\fR=[\fIKEY\fR=\fIVALUE\fR,...]
Preview labels cannot be updated after creation.
.TP 2m
Location resource \- the location to be used as parent. This represents a Cloud
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 \f5\-\-location\fR on the command line with a fully
specified name;
.IP "\(em" 2m
set the property \f5infra\-manager/location\fR 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
.RS 2m
.TP 2m
\fB\-\-location\fR=\fILOCATION\fR
ID of the location or fully qualified identifier for the location.
To set the \f5location\fR attribute:
.RS 2m
.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
.sp
.TP 2m
\fB\-\-preview\-mode\fR=\fIPREVIEW_MODE\fR
Preview mode to set it to either default or delete.
.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 previews create \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 previews create \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 previews create \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 previews create \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 previews create \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 previews create \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 previews create \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.