gcloud_alpha_compute_networks_subnets_create (1)
NAME
- gcloud alpha compute networks subnets create - define a subnet for a network in custom subnet mode
SYNOPSIS
-
gcloud alpha compute networks subnets create NAME --network=NETWORK --range=RANGE [--aggregation-interval=AGGREGATION_INTERVAL] [--description=DESCRIPTION] [--enable-flow-logs] [--enable-private-ip-google-access] [--enable-private-ipv6-access] [--flow-sampling=FLOW_SAMPLING] [--metadata=METADATA] [--purpose=PURPOSE] [--region=REGION] [--role=ROLE] [--secondary-range=PROPERTY=VALUE,[...]] [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
(ALPHA) Define a subnet for a network in custom subnet mode. Subnets must
POSITIONAL ARGUMENTS
-
- NAME
-
Name of the subnetwork to create.
REQUIRED FLAGS
-
- --network=NETWORK
-
The network to which the subnetwork belongs.
- --range=RANGE
-
The IP space allocated to this subnetwork in CIDR format.
OPTIONAL FLAGS
-
- --aggregation-interval=AGGREGATION_INTERVAL
-
Can only be specified if VPC flow logging for this subnetwork is enabled.
Toggles the aggregation interval for collecting flow logs. Increasing the
interval time will reduce the amount of generated flow logs for long lasting
connections. Default is an interval of 5 seconds per connection.
AGGREGATION_INTERVAL must be one of: interval-5-sec,
interval-30-sec, interval-1-min, interval-5-min,
interval-10-min, interval-15-min.
- --description=DESCRIPTION
-
An optional description of this subnetwork.
- --enable-flow-logs
-
Enable/disable VPC flow logging for this subnet. More information for VPC flow
logs can be found at cloud.google.com/vpc/docs/using-flow-logs
- --enable-private-ip-google-access
-
Enable/disable access to Google Cloud APIs from this subnet for instances
without a public ip address.
- --enable-private-ipv6-access
-
Enable/disable private IPv6 access for the subnet.
- --flow-sampling=FLOW_SAMPLING
-
Can only be specified if VPC flow logging for this subnetwork is enabled. The
value of the field must be in [0, 1]. Set the sampling rate of VPC flow logs
within the subnetwork where 1.0 means all collected logs are reported and 0.0
means no logs are reported. Default is 0.5 which means half of all collected
logs are reported.
- --metadata=METADATA
-
Can only be specified if VPC flow logging for this subnetwork is enabled.
Configures whether metadata fields should be added to the reported VPC flow
logs. Default is to include all metadata. METADATA must be one of:
include-all-metadata, exclude-all-metadata.
- --purpose=PURPOSE
-
The purpose of this subnetwork. PURPOSE must be one of:
-
- INTERNAL_HTTPS_LOAD_BALANCER
- Reserved for Internal HTTP(S) Load Balancing.
- PRIVATE
- Regular user created or automatically created subnet.
-
- --region=REGION
-
Region of the subnetwork to create. If not specified, you may be prompted to
select a region.
To avoid prompting when this flag is omitted, you can set the compute/region property:
- $ gcloud config set compute/region REGION
A list of regions can be fetched by running:
- $ gcloud compute regions list
To unset the property, run:
- $ gcloud config unset compute/region
Alternatively, the region can be stored in the environment variable CLOUDSDK_COMPUTE_REGION.
- --role=ROLE
-
The role of subnetwork. This field is only used
whenpurpose=INTERNAL_HTTPS_LOAD_BALANCER. The value can be set to ACTIVE or
BACKUP. An ACTIVE subnetwork is one that is currently being used for Internal
HTTP(S) Load Balancing. A BACKUP subnetwork is one that is ready to be promoted
to ACTIVE or is currently draining. ROLE must be one of:
-
- ACTIVE
- The ACTIVE subnet that is currently used.
- BACKUP
- The BACKUP subnet that could be promoted to ACTIVE.
-
- --secondary-range=PROPERTY=VALUE,[...]
-
Adds a secondary IP range to the subnetwork for use in IP aliasing.
For example, --secondary-range range1=192.168.64.0/24 adds a secondary range 192.168.64.0/24 with name range1.
-
- ---
- RANGE_NAME - Name of the secondary range.
- ---
- RANGE - IP range in CIDR format.
-
GCLOUD WIDE FLAGS
These flags are available to all commands: --account, --configuration, --flags-file, --flatten, --format, --help, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity. Run $ gcloud help for details.
NOTES
This command is currently in ALPHA and may change without notice. If this command fails with API permission errors despite specifying the right project, you will have to apply for early access and have your projects registered on the API whitelist to use it. To do so, contact Support at cloud.google.com/support These variants are also available:
- $ gcloud compute networks subnets create $ gcloud beta compute networks subnets create