- INFORMATION
-
gcloud preview compute security-policies createis not available in universe domainuniverse. - NAME
-
- gcloud preview compute security-policies create - create a Compute Engine security policy
- SYNOPSIS
-
-
gcloud preview compute security-policies createNAME[--description=DESCRIPTION] [--file-format=FILE_FORMAT] [--file-name=FILE_NAME|--type=SECURITY_POLICY_TYPE] [--global|--region=REGION] [GCLOUD_WIDE_FLAG …]
-
- DESCRIPTION
-
(PREVIEW)gcloud preview compute security-policies createis used to create security policies. A security policy policy is a set of rules that controls access to various resources. - EXAMPLES
-
To create a security policy with a given type and description, run:
gcloud preview compute security-policies create my-policy --type=CLOUD_ARMOR_EDGE --description="policy description"To create a security from an input file, run:
gcloud preview compute security-policies create my-policy --file-name=my-file-name - POSITIONAL ARGUMENTS
-
NAME- Name of the security policy to create.
- FLAGS
-
--description=DESCRIPTION- An optional, textual description for the security policy.
--file-format=FILE_FORMAT-
The format of the file to create the security policy config from. Specify either
yaml or json. Defaults to yaml if not specified. Will be ignored if --file-name
is not specified.
FILE_FORMATmust be one of:json,yaml. -
Creation options.
At most one of these can be specified:
--file-name=FILE_NAME- The name of the JSON or YAML file to create a security policy config from.
--type=SECURITY_POLICY_TYPE-
The type indicates the intended use of the security policy.
SECURITY_POLICY_TYPEmust be one of:CLOUD_ARMOR,CLOUD_ARMOR_EDGE,CLOUD_ARMOR_NETWORK.
-
At most one of these can be specified:
--global- If set, the security policy is global.
--region=REGION-
Region of the security policy to create. Overrides the default
compute/regionproperty value for this command invocation.
- 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
$ gcloud helpfor details. - NOTES
-
This command is currently in DEVELOPER PREVIEW and may change without notice. If
this command fails with API permission errors despite specifying the correct
project, you might be trying to access an API with an invitation-only early
access allowlist. These variants are also available:
gcloud compute security-policies creategcloud alpha compute security-policies creategcloud beta compute security-policies create
gcloud preview compute security-policies create
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-04-14 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-04-14 UTC."],[],[]]