File: //snap/google-cloud-cli/396/help/man/man1/gcloud_pubsub_topics_create.1
.TH "GCLOUD_PUBSUB_TOPICS_CREATE" 1
.SH "NAME"
.HP
gcloud pubsub topics create \- creates one or more Cloud Pub/Sub topics
.SH "SYNOPSIS"
.HP
\f5gcloud pubsub topics create\fR \fITOPIC\fR [\fITOPIC\fR\ ...] [\fB\-\-labels\fR=[\fIKEY\fR=\fIVALUE\fR,...]] [\fB\-\-message\-retention\-duration\fR=\fIMESSAGE_RETENTION_DURATION\fR] [\fB\-\-message\-transforms\-file\fR=\fIMESSAGE_TRANSFORMS_FILE\fR] [\fB\-\-ingestion\-log\-severity\fR=\fIINGESTION_LOG_SEVERITY\fR\ \fB\-\-aws\-msk\-ingestion\-aws\-role\-arn\fR=\fIAWS_MSK_INGESTION_AWS_ROLE_ARN\fR\ \fB\-\-aws\-msk\-ingestion\-cluster\-arn\fR=\fIAWS_MSK_INGESTION_CLUSTER_ARN\fR\ \fB\-\-aws\-msk\-ingestion\-service\-account\fR=\fIAWS_MSK_INGESTION_SERVICE_ACCOUNT\fR\ \fB\-\-aws\-msk\-ingestion\-topic\fR=\fIAWS_MSK_INGESTION_TOPIC\fR\ |\ \fB\-\-azure\-event\-hubs\-ingestion\-client\-id\fR=\fIAZURE_EVENT_HUBS_INGESTION_CLIENT_ID\fR\ \fB\-\-azure\-event\-hubs\-ingestion\-event\-hub\fR=\fIAZURE_EVENT_HUBS_INGESTION_EVENT_HUB\fR\ \fB\-\-azure\-event\-hubs\-ingestion\-namespace\fR=\fIAZURE_EVENT_HUBS_INGESTION_NAMESPACE\fR\ \fB\-\-azure\-event\-hubs\-ingestion\-resource\-group\fR=\fIAZURE_EVENT_HUBS_INGESTION_RESOURCE_GROUP\fR\ \fB\-\-azure\-event\-hubs\-ingestion\-service\-account\fR=\fIAZURE_EVENT_HUBS_INGESTION_SERVICE_ACCOUNT\fR\ \fB\-\-azure\-event\-hubs\-ingestion\-subscription\-id\fR=\fIAZURE_EVENT_HUBS_INGESTION_SUBSCRIPTION_ID\fR\ \fB\-\-azure\-event\-hubs\-ingestion\-tenant\-id\fR=\fIAZURE_EVENT_HUBS_INGESTION_TENANT_ID\fR\ |\ [\fB\-\-cloud\-storage\-ingestion\-bucket\fR=\fICLOUD_STORAGE_INGESTION_BUCKET\fR\ \fB\-\-cloud\-storage\-ingestion\-input\-format\fR=\fIINPUT_FORMAT\fR\ :\ \fB\-\-cloud\-storage\-ingestion\-text\-delimiter\fR=\fICLOUD_STORAGE_INGESTION_TEXT_DELIMITER\fR\ \fB\-\-cloud\-storage\-ingestion\-minimum\-object\-create\-time\fR=\fICLOUD_STORAGE_INGESTION_MINIMUM_OBJECT_CREATE_TIME\fR\ \fB\-\-cloud\-storage\-ingestion\-match\-glob\fR=\fICLOUD_STORAGE_INGESTION_MATCH_GLOB\fR]\ |\ \fB\-\-confluent\-cloud\-ingestion\-bootstrap\-server\fR=\fICONFLUENT_CLOUD_INGESTION_BOOTSTRAP_SERVER\fR\ \fB\-\-confluent\-cloud\-ingestion\-cluster\-id\fR=\fICONFLUENT_CLOUD_INGESTION_CLUSTER_ID\fR\ \fB\-\-confluent\-cloud\-ingestion\-identity\-pool\-id\fR=\fICONFLUENT_CLOUD_INGESTION_IDENTITY_POOL_ID\fR\ \fB\-\-confluent\-cloud\-ingestion\-service\-account\fR=\fICONFLUENT_CLOUD_INGESTION_SERVICE_ACCOUNT\fR\ \fB\-\-confluent\-cloud\-ingestion\-topic\fR=\fICONFLUENT_CLOUD_INGESTION_TOPIC\fR\ |\ \fB\-\-kinesis\-ingestion\-consumer\-arn\fR=\fIKINESIS_INGESTION_CONSUMER_ARN\fR\ \fB\-\-kinesis\-ingestion\-role\-arn\fR=\fIKINESIS_INGESTION_ROLE_ARN\fR\ \fB\-\-kinesis\-ingestion\-service\-account\fR=\fIKINESIS_INGESTION_SERVICE_ACCOUNT\fR\ \fB\-\-kinesis\-ingestion\-stream\-arn\fR=\fIKINESIS_INGESTION_STREAM_ARN\fR] [\fB\-\-message\-encoding\fR=\fIENCODING\fR\ (\fB\-\-schema\fR=\fISCHEMA\fR\ :\ \fB\-\-schema\-project\fR=\fISCHEMA_PROJECT\fR)\ :\ \fB\-\-first\-revision\-id\fR=\fIFIRST_REVISION_ID\fR\ \fB\-\-last\-revision\-id\fR=\fILAST_REVISION_ID\fR] [\fB\-\-message\-storage\-policy\-allowed\-regions\fR=[\fIREGION\fR,...]\ :\ \fB\-\-message\-storage\-policy\-enforce\-in\-transit\fR] [\fB\-\-topic\-encryption\-key\fR=\fITOPIC_ENCRYPTION_KEY\fR\ :\ \fB\-\-topic\-encryption\-key\-keyring\fR=\fITOPIC_ENCRYPTION_KEY_KEYRING\fR\ \fB\-\-topic\-encryption\-key\-location\fR=\fITOPIC_ENCRYPTION_KEY_LOCATION\fR\ \fB\-\-topic\-encryption\-key\-project\fR=\fITOPIC_ENCRYPTION_KEY_PROJECT\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]
.SH "DESCRIPTION"
Creates one or more Cloud Pub/Sub topics.
.SH "EXAMPLES"
To create a Cloud Pub/Sub topic, run:
.RS 2m
$ gcloud pubsub topics create mytopic
.RE
.SH "POSITIONAL ARGUMENTS"
.RS 2m
.TP 2m
Topic resource \- One or more topics to create. 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 \f5topic\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
\fITOPIC\fR [\fITOPIC\fR ...]
IDs of the topics or fully qualified identifiers for the topics.
To set the \f5topic\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5topic\fR on the command line.
.RE
.sp
.RE
.RE
.sp
.SH "FLAGS"
.RS 2m
.TP 2m
\fB\-\-labels\fR=[\fIKEY\fR=\fIVALUE\fR,...]
List of label KEY=VALUE pairs to add.
Keys must start with a lowercase character and contain only hyphens (\f5\-\fR),
underscores (\f5_\fR), lowercase characters, and numbers. Values must contain
only hyphens (\f5\-\fR), underscores (\f5_\fR), lowercase characters, and
numbers.
.TP 2m
\fB\-\-message\-retention\-duration\fR=\fIMESSAGE_RETENTION_DURATION\fR
Indicates the minimum duration to retain a message after it is published to the
topic. If this field is set, messages published to the topic in the last
MESSAGE_RETENTION_DURATION are always available to subscribers. For instance, it
allows any attached subscription to seek to a timestamp that is up to
MESSAGE_RETENTION_DURATION in the past. If this field is not set, message
retention is controlled by settings on individual subscriptions. The minimum is
10 minutes and the maximum is 31 days. Valid values are strings of the form
INTEGER[UNIT], where UNIT is one of "s", "m", "h", and "d" for seconds, minutes,
hours, and days, respectively. If the unit is omitted, seconds is assumed.
.TP 2m
\fB\-\-message\-transforms\-file\fR=\fIMESSAGE_TRANSFORMS_FILE\fR
Path to YAML or JSON file containing message transforms.
.TP 2m
Following flags are for specifying the data source settings for an import topic
.RS 2m
.TP 2m
\fB\-\-ingestion\-log\-severity\fR=\fIINGESTION_LOG_SEVERITY\fR
Log severity to use for ingestion.
.TP 2m
At most one of these can be specified:
.RS 2m
.TP 2m
Flags that specify settings for an import topic from Amazon Web Services (AWS)
Managed Streaming for Apache Kafka (MSK)
.RS 2m
.TP 2m
\fB\-\-aws\-msk\-ingestion\-aws\-role\-arn\fR=\fIAWS_MSK_INGESTION_AWS_ROLE_ARN\fR
AWS role ARN to be used for Federated Identity authentication with MSK.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-aws\-msk\-ingestion\-cluster\-arn\fR=\fIAWS_MSK_INGESTION_CLUSTER_ARN\fR
ARN that uniquely identifies the MSK cluster.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-aws\-msk\-ingestion\-service\-account\fR=\fIAWS_MSK_INGESTION_SERVICE_ACCOUNT\fR
Google Cloud service account to be used for Federated Identity authentication
with MSK.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-aws\-msk\-ingestion\-topic\fR=\fIAWS_MSK_INGESTION_TOPIC\fR
Name of the MSK topic that Pub/Sub will import from.
This flag argument must be specified if any of the other arguments in this group
are specified.
.RE
.sp
.TP 2m
Flags that specify settings for an import topic from Azure Event Hubs
.RS 2m
.TP 2m
\fB\-\-azure\-event\-hubs\-ingestion\-client\-id\fR=\fIAZURE_EVENT_HUBS_INGESTION_CLIENT_ID\fR
Azure Event Hubs client ID to use for ingestion.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-azure\-event\-hubs\-ingestion\-event\-hub\fR=\fIAZURE_EVENT_HUBS_INGESTION_EVENT_HUB\fR
Azure event hub from which to ingest data.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-azure\-event\-hubs\-ingestion\-namespace\fR=\fIAZURE_EVENT_HUBS_INGESTION_NAMESPACE\fR
Azure Event Hubs namespace from which to ingest data.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-azure\-event\-hubs\-ingestion\-resource\-group\fR=\fIAZURE_EVENT_HUBS_INGESTION_RESOURCE_GROUP\fR
Azure Event Hubs resource group from within an Azure subscription.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-azure\-event\-hubs\-ingestion\-service\-account\fR=\fIAZURE_EVENT_HUBS_INGESTION_SERVICE_ACCOUNT\fR
Google Cloud service account to be used for Federated Identity authentication
with Azure Event Hubs.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-azure\-event\-hubs\-ingestion\-subscription\-id\fR=\fIAZURE_EVENT_HUBS_INGESTION_SUBSCRIPTION_ID\fR
Azure Event Hubs subscription ID to use for ingestion.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-azure\-event\-hubs\-ingestion\-tenant\-id\fR=\fIAZURE_EVENT_HUBS_INGESTION_TENANT_ID\fR
Azure Event Hubs tenant ID to use for ingestion.
This flag argument must be specified if any of the other arguments in this group
are specified.
.RE
.sp
.TP 2m
Flags that specify settings for an import topic from Cloud Storage
.RS 2m
.TP 2m
\fB\-\-cloud\-storage\-ingestion\-bucket\fR=\fICLOUD_STORAGE_INGESTION_BUCKET\fR
Cloud Storage bucket from which to ingest data.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-cloud\-storage\-ingestion\-input\-format\fR=\fIINPUT_FORMAT\fR
Format of the data in the Cloud Storage bucket. \fIINPUT_FORMAT\fR must be one
of: \fBtext\fR, \fBavro\fR, \fBpubsub_avro\fR.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-cloud\-storage\-ingestion\-text\-delimiter\fR=\fICLOUD_STORAGE_INGESTION_TEXT_DELIMITER\fR
Delimiter to use with text format when partitioning the object.
.TP 2m
\fB\-\-cloud\-storage\-ingestion\-minimum\-object\-create\-time\fR=\fICLOUD_STORAGE_INGESTION_MINIMUM_OBJECT_CREATE_TIME\fR
Only Cloud Storage objects with a larger or equal creation timestamp will be
ingested.
.TP 2m
\fB\-\-cloud\-storage\-ingestion\-match\-glob\fR=\fICLOUD_STORAGE_INGESTION_MATCH_GLOB\fR
Glob pattern used to match Cloud Storage objects that will be ingested. If
unset, all objects will be ingested.
.RE
.sp
.TP 2m
Flags that specify settings for an import topic from Confluent Cloud
.RS 2m
.TP 2m
\fB\-\-confluent\-cloud\-ingestion\-bootstrap\-server\fR=\fICONFLUENT_CLOUD_INGESTION_BOOTSTRAP_SERVER\fR
Confluent Cloud bootstrap server. The format is url:port.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-confluent\-cloud\-ingestion\-cluster\-id\fR=\fICONFLUENT_CLOUD_INGESTION_CLUSTER_ID\fR
Confluent Cloud cluster ID.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-confluent\-cloud\-ingestion\-identity\-pool\-id\fR=\fICONFLUENT_CLOUD_INGESTION_IDENTITY_POOL_ID\fR
Identity pool ID to be used for Federated Identity authentication with Confluent
Cloud.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-confluent\-cloud\-ingestion\-service\-account\fR=\fICONFLUENT_CLOUD_INGESTION_SERVICE_ACCOUNT\fR
Google Cloud service account to be used for Federated Identity authentication
with Confluent Cloud.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-confluent\-cloud\-ingestion\-topic\fR=\fICONFLUENT_CLOUD_INGESTION_TOPIC\fR
Name of the Confluent Cloud topic that Pub/Sub will import from.
This flag argument must be specified if any of the other arguments in this group
are specified.
.RE
.sp
.TP 2m
Flags that specify settings for an import topic from Amazon Web Services (AWS)
Kinesis Data Streams
.RS 2m
.TP 2m
\fB\-\-kinesis\-ingestion\-consumer\-arn\fR=\fIKINESIS_INGESTION_CONSUMER_ARN\fR
Kinesis data streams consumer Amazon Resource Name (ARN) to use for ingestion.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-kinesis\-ingestion\-role\-arn\fR=\fIKINESIS_INGESTION_ROLE_ARN\fR
AWS role ARN to be used for Federated Identity authentication with Kinesis.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-kinesis\-ingestion\-service\-account\fR=\fIKINESIS_INGESTION_SERVICE_ACCOUNT\fR
Google Cloud service account to be used for Federated Identity authentication
with Kinesis.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-kinesis\-ingestion\-stream\-arn\fR=\fIKINESIS_INGESTION_STREAM_ARN\fR
Kinesis data stream ARN from which to ingest data.
This flag argument must be specified if any of the other arguments in this group
are specified.
.RE
.RE
.RE
.sp
.TP 2m
Schema settings. The schema that messages published to this topic must conform
to and the expected message encoding.
.RS 2m
.TP 2m
\fB\-\-message\-encoding\fR=\fIENCODING\fR
The encoding of messages validated against the schema. \fIENCODING\fR must be
one of: \fBjson\fR, \fBbinary\fR.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-first\-revision\-id\fR=\fIFIRST_REVISION_ID\fR
The id of the oldest revision allowed for the specified schema.
.TP 2m
\fB\-\-last\-revision\-id\fR=\fILAST_REVISION_ID\fR
The id of the most recent revision allowed for the specified schema
.TP 2m
Schema resource \- Name of the schema that messages published to this topic must
conform to. The arguments in this group can be used to specify the attributes of
this resource.
This must be specified.
.RS 2m
.TP 2m
\fB\-\-schema\fR=\fISCHEMA\fR
ID of the schema or fully qualified identifier for the schema.
To set the \f5schema\fR attribute:
.RS 2m
.IP "\(em" 2m
provide the argument \f5\-\-schema\fR on the command line.
.RE
.sp
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-schema\-project\fR=\fISCHEMA_PROJECT\fR
Project ID of the Google Cloud project for the schema.
To set the \f5project\fR attribute:
.RS 2m
.IP "\(em" 2m
provide the argument \f5\-\-schema\fR on the command line with a fully specified
name;
.IP "\(em" 2m
provide the argument \f5\-\-schema\-project\fR on the command line;
.IP "\(em" 2m
provide the argument \f5\-\-project\fR on the command line;
.IP "\(em" 2m
set the property \f5core/project\fR.
.RE
.sp
.RE
.RE
.sp
.TP 2m
Options for explicitly specifying the message storage policy
(https://cloud.google.com/pubsub/docs/resource\-location\-restriction) for a
topic.
.RS 2m
.TP 2m
\fB\-\-message\-storage\-policy\-allowed\-regions\fR=[\fIREGION\fR,...]
A list of one or more Cloud regions where messages are allowed to be stored at
rest.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-message\-storage\-policy\-enforce\-in\-transit\fR
Whether or not to enforce in\-transit guarantees for this topic using the
allowed regions. This ensures that publishing, pulling, and push delivery are
only handled in allowed Cloud regions.
.RE
.sp
.TP 2m
Key resource \- The Cloud KMS (Key Management Service) cryptokey that will be
used to protect the topic. The specified Cloud KMS key should have purpose set
to "ENCRYPT_DECRYPT". The service account,
"service\-${CONSUMER_PROJECT_NUMBER}@gcp\-sa\-pubsub.iam.gserviceaccount.com"
requires the IAM cryptoKeyEncrypterDecrypter role for the given Cloud KMS key.
CONSUMER_PROJECT_NUMBER is the project number of the project that is the parent
of the topic being created. The arguments in this group can be used to specify
the attributes of this resource.
.RS 2m
.TP 2m
\fB\-\-topic\-encryption\-key\fR=\fITOPIC_ENCRYPTION_KEY\fR
ID of the key or fully qualified identifier for the key.
To set the \f5kms\-key\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5\-\-topic\-encryption\-key\fR on the command line.
.RE
.sp
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-topic\-encryption\-key\-keyring\fR=\fITOPIC_ENCRYPTION_KEY_KEYRING\fR
The KMS keyring of the key.
To set the \f5kms\-keyring\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5\-\-topic\-encryption\-key\fR on the command line with a
fully specified name;
.IP "\(bu" 2m
provide the argument \f5\-\-topic\-encryption\-key\-keyring\fR on the command
line.
.RE
.sp
.TP 2m
\fB\-\-topic\-encryption\-key\-location\fR=\fITOPIC_ENCRYPTION_KEY_LOCATION\fR
The Google Cloud location for the key.
To set the \f5kms\-location\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5\-\-topic\-encryption\-key\fR on the command line with a
fully specified name;
.IP "\(bu" 2m
provide the argument \f5\-\-topic\-encryption\-key\-location\fR on the command
line.
.RE
.sp
.TP 2m
\fB\-\-topic\-encryption\-key\-project\fR=\fITOPIC_ENCRYPTION_KEY_PROJECT\fR
The Google Cloud project for the key.
To set the \f5kms\-project\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5\-\-topic\-encryption\-key\fR on the command line with a
fully specified name;
.IP "\(bu" 2m
provide the argument \f5\-\-topic\-encryption\-key\-project\fR on the command
line;
.IP "\(bu" 2m
set the property \f5core/project\fR.
.RE
.sp
.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.
.SH "NOTES"
These variants are also available:
.RS 2m
$ gcloud alpha pubsub topics create
.RE
.RS 2m
$ gcloud beta pubsub topics create
.RE