This page documents the language specification for the gcp package. If you're looking for help working with the inputs, outputs, or functions of gcp resources in a Pulumi program, please see the resource documentation for examples and API reference.
accesscontextmanager¶
This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-gcp repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-google repo.
- class
pulumi_gcp.accesscontextmanager.AccessLevel(resource_name, opts=None, basic=None, custom=None, description=None, name=None, parent=None, title=None, __props__=None, __name__=None, __opts__=None)¶ An AccessLevel is a label that can be applied to requests to GCP services, along with a list of requirements necessary for the label to be applied.
To get more information about AccessLevel, see:
How-to Guides
import pulumi import pulumi_gcp as gcp access_policy = gcp.accesscontextmanager.AccessPolicy("access-policy", parent="organizations/123456789", title="my policy") access_level = gcp.accesscontextmanager.AccessLevel("access-level", basic={ "conditions": [{ "devicePolicy": { "osConstraints": [{ "osType": "DESKTOP_CHROME_OS", }], "requireScreenLock": True, }, "regions": [ "CH", "IT", "US", ], }], }, parent=access_policy.name.apply(lambda name: f"accessPolicies/{name}"), title="chromeos_no_lock")
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
basic (pulumi.Input[dict]) – A set of predefined conditions for the access level and a combining function. Structure is documented below.
custom (pulumi.Input[dict]) – Custom access level conditions are set using the Cloud Common Expression Language to represent the necessary conditions for the level to apply to a request. See CEL spec at: https://github.com/google/cel-spec. Structure is documented below.
description (pulumi.Input[str]) – Description of the expression
name (pulumi.Input[str]) – Resource name for the Access Level. The shortname component must begin with a letter and only include alphanumeric and ‘’. Format: accessPolicies/{policy_id}/accessLevels/{short_name}
parent (pulumi.Input[str]) – The AccessPolicy this AccessLevel lives in. Format: accessPolicies/{policy_id}
title (pulumi.Input[str]) – Title for the expression, i.e. a short string describing its purpose.
The basic object supports the following:
combiningFunction(pulumi.Input[str]) - How the conditions list should be combined to determine if a request is granted this AccessLevel. If AND is used, each Condition in conditions must be satisfied for the AccessLevel to be applied. If OR is used, at least one Condition in conditions must be satisfied for the AccessLevel to be applied.conditions(pulumi.Input[list]) - A set of requirements for the AccessLevel to be granted. Structure is documented below.devicePolicy(pulumi.Input[dict]) - Device specific restrictions, all restrictions must hold for the Condition to be true. If not specified, all devices are allowed. Structure is documented below.allowedDeviceManagementLevels(pulumi.Input[list]) - A list of allowed device management levels. An empty list allows all management levels.allowedEncryptionStatuses(pulumi.Input[list]) - A list of allowed encryptions statuses. An empty list allows all statuses.osConstraints(pulumi.Input[list]) - A list of allowed OS versions. An empty list allows all types and all versions. Structure is documented below.minimumVersion(pulumi.Input[str]) - The minimum allowed OS version. If not set, any version of this OS satisfies the constraint. Format: “major.minor.patch” such as “10.5.301”, “9.2.1”.osType(pulumi.Input[str]) - The operating system type of the device.
requireAdminApproval(pulumi.Input[bool]) - Whether the device needs to be approved by the customer admin.requireCorpOwned(pulumi.Input[bool]) - Whether the device needs to be corp owned.requireScreenLock(pulumi.Input[bool]) - Whether or not screenlock is required for the DevicePolicy to be true. Defaults to false.
ipSubnetworks(pulumi.Input[list]) - A list of CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for a CIDR IP address block, the specified IP address portion must be properly truncated (i.e. all the host bits must be zero) or the input is considered malformed. For example, “192.0.2.0/24” is accepted but “192.0.2.1/24” is not. Similarly, for IPv6, “2001:db8::/32” is accepted whereas “2001:db8::1/32” is not. The originating IP of a request must be in one of the listed subnets in order for this Condition to be true. If empty, all IP addresses are allowed.members(pulumi.Input[list]) - An allowed list of members (users, service accounts). Using groups is not supported yet. The signed-in user originating the request must be a part of one of the provided members. If not specified, a request may come from any user (logged in/not logged in, not present in any groups, etc.). Formats:user:{emailid},serviceAccount:{emailid}negate(pulumi.Input[bool]) - Whether to negate the Condition. If true, the Condition becomes a NAND over its non-empty fields, each field must be false for the Condition overall to be satisfied. Defaults to false.regions(pulumi.Input[list]) - The request must originate from one of the provided countries/regions. Format: A valid ISO 3166-1 alpha-2 code.requiredAccessLevels(pulumi.Input[list]) - A list of other access levels defined in the same Policy, referenced by resource name. Referencing an AccessLevel which does not exist is an error. All access levels listed must be granted for the Condition to be true. Format: accessPolicies/{policy_id}/accessLevels/{short_name}
The custom object supports the following:
expr(pulumi.Input[dict]) - Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. This page details the objects and attributes that are used to the build the CEL expressions for custom access levels - https://cloud.google.com/access-context-manager/docs/custom-access-level-spec. Structure is documented below.description(pulumi.Input[str]) - Description of the expressionexpression(pulumi.Input[str]) - Textual representation of an expression in Common Expression Language syntax.location(pulumi.Input[str]) - String indicating the location of the expression for error reporting, e.g. a file name and a position in the filetitle(pulumi.Input[str]) - Title for the expression, i.e. a short string describing its purpose.
basic: pulumi.Output[dict] = None¶A set of predefined conditions for the access level and a combining function. Structure is documented below.
combiningFunction(str) - How the conditions list should be combined to determine if a request is granted this AccessLevel. If AND is used, each Condition in conditions must be satisfied for the AccessLevel to be applied. If OR is used, at least one Condition in conditions must be satisfied for the AccessLevel to be applied.conditions(list) - A set of requirements for the AccessLevel to be granted. Structure is documented below.devicePolicy(dict) - Device specific restrictions, all restrictions must hold for the Condition to be true. If not specified, all devices are allowed. Structure is documented below.allowedDeviceManagementLevels(list) - A list of allowed device management levels. An empty list allows all management levels.allowedEncryptionStatuses(list) - A list of allowed encryptions statuses. An empty list allows all statuses.osConstraints(list) - A list of allowed OS versions. An empty list allows all types and all versions. Structure is documented below.minimumVersion(str) - The minimum allowed OS version. If not set, any version of this OS satisfies the constraint. Format: “major.minor.patch” such as “10.5.301”, “9.2.1”.osType(str) - The operating system type of the device.
requireAdminApproval(bool) - Whether the device needs to be approved by the customer admin.requireCorpOwned(bool) - Whether the device needs to be corp owned.requireScreenLock(bool) - Whether or not screenlock is required for the DevicePolicy to be true. Defaults to false.
ipSubnetworks(list) - A list of CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for a CIDR IP address block, the specified IP address portion must be properly truncated (i.e. all the host bits must be zero) or the input is considered malformed. For example, “192.0.2.0/24” is accepted but “192.0.2.1/24” is not. Similarly, for IPv6, “2001:db8::/32” is accepted whereas “2001:db8::1/32” is not. The originating IP of a request must be in one of the listed subnets in order for this Condition to be true. If empty, all IP addresses are allowed.members(list) - An allowed list of members (users, service accounts). Using groups is not supported yet. The signed-in user originating the request must be a part of one of the provided members. If not specified, a request may come from any user (logged in/not logged in, not present in any groups, etc.). Formats:user:{emailid},serviceAccount:{emailid}negate(bool) - Whether to negate the Condition. If true, the Condition becomes a NAND over its non-empty fields, each field must be false for the Condition overall to be satisfied. Defaults to false.regions(list) - The request must originate from one of the provided countries/regions. Format: A valid ISO 3166-1 alpha-2 code.requiredAccessLevels(list) - A list of other access levels defined in the same Policy, referenced by resource name. Referencing an AccessLevel which does not exist is an error. All access levels listed must be granted for the Condition to be true. Format: accessPolicies/{policy_id}/accessLevels/{short_name}
custom: pulumi.Output[dict] = None¶Custom access level conditions are set using the Cloud Common Expression Language to represent the necessary conditions for the level to apply to a request. See CEL spec at: https://github.com/google/cel-spec. Structure is documented below.
expr(dict) - Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. This page details the objects and attributes that are used to the build the CEL expressions for custom access levels - https://cloud.google.com/access-context-manager/docs/custom-access-level-spec. Structure is documented below.description(str) - Description of the expressionexpression(str) - Textual representation of an expression in Common Expression Language syntax.location(str) - String indicating the location of the expression for error reporting, e.g. a file name and a position in the filetitle(str) - Title for the expression, i.e. a short string describing its purpose.
description: pulumi.Output[str] = None¶Description of the expression
name: pulumi.Output[str] = None¶Resource name for the Access Level. The shortname component must begin with a letter and only include alphanumeric and ‘’. Format: accessPolicies/{policy_id}/accessLevels/{short_name}
parent: pulumi.Output[str] = None¶The AccessPolicy this AccessLevel lives in. Format: accessPolicies/{policy_id}
title: pulumi.Output[str] = None¶Title for the expression, i.e. a short string describing its purpose.
- static
get(resource_name, id, opts=None, basic=None, custom=None, description=None, name=None, parent=None, title=None)¶ Get an existing AccessLevel resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
basic (pulumi.Input[dict]) – A set of predefined conditions for the access level and a combining function. Structure is documented below.
custom (pulumi.Input[dict]) – Custom access level conditions are set using the Cloud Common Expression Language to represent the necessary conditions for the level to apply to a request. See CEL spec at: https://github.com/google/cel-spec. Structure is documented below.
description (pulumi.Input[str]) – Description of the expression
name (pulumi.Input[str]) – Resource name for the Access Level. The shortname component must begin with a letter and only include alphanumeric and ‘’. Format: accessPolicies/{policy_id}/accessLevels/{short_name}
parent (pulumi.Input[str]) – The AccessPolicy this AccessLevel lives in. Format: accessPolicies/{policy_id}
title (pulumi.Input[str]) – Title for the expression, i.e. a short string describing its purpose.
The basic object supports the following:
combiningFunction(pulumi.Input[str]) - How the conditions list should be combined to determine if a request is granted this AccessLevel. If AND is used, each Condition in conditions must be satisfied for the AccessLevel to be applied. If OR is used, at least one Condition in conditions must be satisfied for the AccessLevel to be applied.conditions(pulumi.Input[list]) - A set of requirements for the AccessLevel to be granted. Structure is documented below.devicePolicy(pulumi.Input[dict]) - Device specific restrictions, all restrictions must hold for the Condition to be true. If not specified, all devices are allowed. Structure is documented below.allowedDeviceManagementLevels(pulumi.Input[list]) - A list of allowed device management levels. An empty list allows all management levels.allowedEncryptionStatuses(pulumi.Input[list]) - A list of allowed encryptions statuses. An empty list allows all statuses.osConstraints(pulumi.Input[list]) - A list of allowed OS versions. An empty list allows all types and all versions. Structure is documented below.minimumVersion(pulumi.Input[str]) - The minimum allowed OS version. If not set, any version of this OS satisfies the constraint. Format: “major.minor.patch” such as “10.5.301”, “9.2.1”.osType(pulumi.Input[str]) - The operating system type of the device.
requireAdminApproval(pulumi.Input[bool]) - Whether the device needs to be approved by the customer admin.requireCorpOwned(pulumi.Input[bool]) - Whether the device needs to be corp owned.requireScreenLock(pulumi.Input[bool]) - Whether or not screenlock is required for the DevicePolicy to be true. Defaults to false.
ipSubnetworks(pulumi.Input[list]) - A list of CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for a CIDR IP address block, the specified IP address portion must be properly truncated (i.e. all the host bits must be zero) or the input is considered malformed. For example, “192.0.2.0/24” is accepted but “192.0.2.1/24” is not. Similarly, for IPv6, “2001:db8::/32” is accepted whereas “2001:db8::1/32” is not. The originating IP of a request must be in one of the listed subnets in order for this Condition to be true. If empty, all IP addresses are allowed.members(pulumi.Input[list]) - An allowed list of members (users, service accounts). Using groups is not supported yet. The signed-in user originating the request must be a part of one of the provided members. If not specified, a request may come from any user (logged in/not logged in, not present in any groups, etc.). Formats:user:{emailid},serviceAccount:{emailid}negate(pulumi.Input[bool]) - Whether to negate the Condition. If true, the Condition becomes a NAND over its non-empty fields, each field must be false for the Condition overall to be satisfied. Defaults to false.regions(pulumi.Input[list]) - The request must originate from one of the provided countries/regions. Format: A valid ISO 3166-1 alpha-2 code.requiredAccessLevels(pulumi.Input[list]) - A list of other access levels defined in the same Policy, referenced by resource name. Referencing an AccessLevel which does not exist is an error. All access levels listed must be granted for the Condition to be true. Format: accessPolicies/{policy_id}/accessLevels/{short_name}
The custom object supports the following:
expr(pulumi.Input[dict]) - Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. This page details the objects and attributes that are used to the build the CEL expressions for custom access levels - https://cloud.google.com/access-context-manager/docs/custom-access-level-spec. Structure is documented below.description(pulumi.Input[str]) - Description of the expressionexpression(pulumi.Input[str]) - Textual representation of an expression in Common Expression Language syntax.location(pulumi.Input[str]) - String indicating the location of the expression for error reporting, e.g. a file name and a position in the filetitle(pulumi.Input[str]) - Title for the expression, i.e. a short string describing its purpose.
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
- class
pulumi_gcp.accesscontextmanager.AccessPolicy(resource_name, opts=None, parent=None, title=None, __props__=None, __name__=None, __opts__=None)¶ AccessPolicy is a container for AccessLevels (which define the necessary attributes to use GCP services) and ServicePerimeters (which define regions of services able to freely pass data within a perimeter). An access policy is globally visible within an organization, and the restrictions it specifies apply to all projects within an organization.
To get more information about AccessPolicy, see:
How-to Guides
import pulumi import pulumi_gcp as gcp access_policy = gcp.accesscontextmanager.AccessPolicy("access-policy", parent="organizations/123456789", title="my policy")
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
parent (pulumi.Input[str]) – The parent of this AccessPolicy in the Cloud Resource Hierarchy. Format: organizations/{organization_id}
title (pulumi.Input[str]) – Human readable title. Does not affect behavior.
create_time: pulumi.Output[str] = None¶Time the AccessPolicy was created in UTC.
name: pulumi.Output[str] = None¶Resource name of the AccessPolicy. Format: {policy_id}
parent: pulumi.Output[str] = None¶The parent of this AccessPolicy in the Cloud Resource Hierarchy. Format: organizations/{organization_id}
title: pulumi.Output[str] = None¶Human readable title. Does not affect behavior.
update_time: pulumi.Output[str] = None¶Time the AccessPolicy was updated in UTC.
- static
get(resource_name, id, opts=None, create_time=None, name=None, parent=None, title=None, update_time=None)¶ Get an existing AccessPolicy resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
create_time (pulumi.Input[str]) – Time the AccessPolicy was created in UTC.
name (pulumi.Input[str]) – Resource name of the AccessPolicy. Format: {policy_id}
parent (pulumi.Input[str]) – The parent of this AccessPolicy in the Cloud Resource Hierarchy. Format: organizations/{organization_id}
title (pulumi.Input[str]) – Human readable title. Does not affect behavior.
update_time (pulumi.Input[str]) – Time the AccessPolicy was updated in UTC.
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
- class
pulumi_gcp.accesscontextmanager.ServicePerimeter(resource_name, opts=None, description=None, name=None, parent=None, perimeter_type=None, spec=None, status=None, title=None, use_explicit_dry_run_spec=None, __props__=None, __name__=None, __opts__=None)¶ ServicePerimeter describes a set of GCP resources which can freely import and export data amongst themselves, but not export outside of the ServicePerimeter. If a request with a source within this ServicePerimeter has a target outside of the ServicePerimeter, the request will be blocked. Otherwise the request is allowed. There are two types of Service Perimeter
Regular and Bridge. Regular Service Perimeters cannot overlap, a single GCP project can only belong to a single regular Service Perimeter. Service Perimeter Bridges can contain only GCP projects as members, a single GCP project may belong to multiple Service Perimeter Bridges.
To get more information about ServicePerimeter, see:
How-to Guides
import pulumi import pulumi_gcp as gcp access_policy = gcp.accesscontextmanager.AccessPolicy("access-policy", parent="organizations/123456789", title="my policy") service_perimeter = gcp.accesscontextmanager.ServicePerimeter("service-perimeter", parent=access_policy.name.apply(lambda name: f"accessPolicies/{name}"), status={ "restrictedServices": ["storage.googleapis.com"], }, title="restrict_storage") access_level = gcp.accesscontextmanager.AccessLevel("access-level", basic={ "conditions": [{ "devicePolicy": { "osConstraints": [{ "osType": "DESKTOP_CHROME_OS", }], "requireScreenLock": False, }, "regions": [ "CH", "IT", "US", ], }], }, parent=access_policy.name.apply(lambda name: f"accessPolicies/{name}"), title="chromeos_no_lock")
import pulumi import pulumi_gcp as gcp access_policy = gcp.accesscontextmanager.AccessPolicy("access-policy", parent="organizations/123456789", title="my policy") service_perimeter = gcp.accesscontextmanager.ServicePerimeter("service-perimeter", parent=access_policy.name.apply(lambda name: f"accessPolicies/{name}"), spec={ "restrictedServices": ["storage.googleapis.com"], }, status={ "restrictedServices": ["bigquery.googleapis.com"], }, title="restrict_bigquery_dryrun_storage", use_explicit_dry_run_spec=True)
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
description (pulumi.Input[str]) – Description of the ServicePerimeter and its use. Does not affect behavior.
name (pulumi.Input[str]) – Resource name for the ServicePerimeter. The shortname component must begin with a letter and only include alphanumeric and ‘’. Format: accessPolicies/{policy_id}/servicePerimeters/{short_name}
parent (pulumi.Input[str]) – The AccessPolicy this ServicePerimeter lives in. Format: accessPolicies/{policy_id}
perimeter_type (pulumi.Input[str]) – Specifies the type of the Perimeter. There are two types: regular and bridge. Regular Service Perimeter contains resources, access levels, and restricted services. Every resource can be in at most ONE regular Service Perimeter. In addition to being in a regular service perimeter, a resource can also be in zero or more perimeter bridges. A perimeter bridge only contains resources. Cross project operations are permitted if all effected resources share some perimeter (whether bridge or regular). Perimeter Bridge does not contain access levels or services: those are governed entirely by the regular perimeter that resource is in. Perimeter Bridges are typically useful when building more complex topologies with many independent perimeters that need to share some data with a common perimeter, but should not be able to share data among themselves.
spec (pulumi.Input[dict]) – Proposed (or dry run) ServicePerimeter configuration. This configuration allows to specify and test ServicePerimeter configuration without enforcing actual access restrictions. Only allowed to be set when the
useExplicitDryRunSpecflag is set. Structure is documented below.status (pulumi.Input[dict]) – ServicePerimeter configuration. Specifies sets of resources, restricted services and access levels that determine perimeter content and boundaries. Structure is documented below.
title (pulumi.Input[str]) – Human readable title. Must be unique within the Policy.
use_explicit_dry_run_spec (pulumi.Input[bool]) – Use explicit dry run spec flag. Ordinarily, a dry-run spec implicitly exists for all Service Perimeters, and that spec is identical to the status for those Service Perimeters. When this flag is set, it inhibits the generation of the implicit spec, thereby allowing the user to explicitly provide a configuration (“spec”) to use in a dry-run version of the Service Perimeter. This allows the user to test changes to the enforced config (“status”) without actually enforcing them. This testing is done through analyzing the differences between currently enforced and suggested restrictions. useExplicitDryRunSpec must bet set to True if any of the fields in the spec are set to non-default values.
The spec object supports the following:
accessLevels(pulumi.Input[list]) - A list of AccessLevel resource names that allow resources within the ServicePerimeter to be accessed from the internet. AccessLevels listed must be in the same policy as this ServicePerimeter. Referencing a nonexistent AccessLevel is a syntax error. If no AccessLevel names are listed, resources within the perimeter can only be accessed via GCP calls with request origins within the perimeter. For Service Perimeter Bridge, must be empty. Format: accessPolicies/{policy_id}/accessLevels/{access_level_name}resources(pulumi.Input[list]) - A list of GCP resources that are inside of the service perimeter. Currently only projects are allowed. Format: projects/{project_number}restrictedServices(pulumi.Input[list]) - GCP services that are subject to the Service Perimeter restrictions. Must contain a list of services. For example, ifstorage.googleapis.comis specified, access to the storage buckets inside the perimeter must meet the perimeter’s access restrictions.vpcAccessibleServices(pulumi.Input[dict]) - Specifies how APIs are allowed to communicate within the Service Perimeter. Structure is documented below.allowedServices(pulumi.Input[list]) - The list of APIs usable within the Service Perimeter. Must be empty unlessenableRestrictionis True.enableRestriction(pulumi.Input[bool]) - Whether to restrict API calls within the Service Perimeter to the list of APIs specified in ‘allowedServices’.
The status object supports the following:
accessLevels(pulumi.Input[list]) - A list of AccessLevel resource names that allow resources within the ServicePerimeter to be accessed from the internet. AccessLevels listed must be in the same policy as this ServicePerimeter. Referencing a nonexistent AccessLevel is a syntax error. If no AccessLevel names are listed, resources within the perimeter can only be accessed via GCP calls with request origins within the perimeter. For Service Perimeter Bridge, must be empty. Format: accessPolicies/{policy_id}/accessLevels/{access_level_name}resources(pulumi.Input[list]) - A list of GCP resources that are inside of the service perimeter. Currently only projects are allowed. Format: projects/{project_number}restrictedServices(pulumi.Input[list]) - GCP services that are subject to the Service Perimeter restrictions. Must contain a list of services. For example, ifstorage.googleapis.comis specified, access to the storage buckets inside the perimeter must meet the perimeter’s access restrictions.vpcAccessibleServices(pulumi.Input[dict]) - Specifies how APIs are allowed to communicate within the Service Perimeter. Structure is documented below.allowedServices(pulumi.Input[list]) - The list of APIs usable within the Service Perimeter. Must be empty unlessenableRestrictionis True.enableRestriction(pulumi.Input[bool]) - Whether to restrict API calls within the Service Perimeter to the list of APIs specified in ‘allowedServices’.
create_time: pulumi.Output[str] = None¶Time the AccessPolicy was created in UTC.
description: pulumi.Output[str] = None¶Description of the ServicePerimeter and its use. Does not affect behavior.
name: pulumi.Output[str] = None¶Resource name for the ServicePerimeter. The shortname component must begin with a letter and only include alphanumeric and ‘’. Format: accessPolicies/{policy_id}/servicePerimeters/{short_name}
parent: pulumi.Output[str] = None¶The AccessPolicy this ServicePerimeter lives in. Format: accessPolicies/{policy_id}
perimeter_type: pulumi.Output[str] = None¶Specifies the type of the Perimeter. There are two types: regular and bridge. Regular Service Perimeter contains resources, access levels, and restricted services. Every resource can be in at most ONE regular Service Perimeter. In addition to being in a regular service perimeter, a resource can also be in zero or more perimeter bridges. A perimeter bridge only contains resources. Cross project operations are permitted if all effected resources share some perimeter (whether bridge or regular). Perimeter Bridge does not contain access levels or services: those are governed entirely by the regular perimeter that resource is in. Perimeter Bridges are typically useful when building more complex topologies with many independent perimeters that need to share some data with a common perimeter, but should not be able to share data among themselves.
spec: pulumi.Output[dict] = None¶Proposed (or dry run) ServicePerimeter configuration. This configuration allows to specify and test ServicePerimeter configuration without enforcing actual access restrictions. Only allowed to be set when the
useExplicitDryRunSpecflag is set. Structure is documented below.accessLevels(list) - A list of AccessLevel resource names that allow resources within the ServicePerimeter to be accessed from the internet. AccessLevels listed must be in the same policy as this ServicePerimeter. Referencing a nonexistent AccessLevel is a syntax error. If no AccessLevel names are listed, resources within the perimeter can only be accessed via GCP calls with request origins within the perimeter. For Service Perimeter Bridge, must be empty. Format: accessPolicies/{policy_id}/accessLevels/{access_level_name}resources(list) - A list of GCP resources that are inside of the service perimeter. Currently only projects are allowed. Format: projects/{project_number}restrictedServices(list) - GCP services that are subject to the Service Perimeter restrictions. Must contain a list of services. For example, ifstorage.googleapis.comis specified, access to the storage buckets inside the perimeter must meet the perimeter’s access restrictions.vpcAccessibleServices(dict) - Specifies how APIs are allowed to communicate within the Service Perimeter. Structure is documented below.allowedServices(list) - The list of APIs usable within the Service Perimeter. Must be empty unlessenableRestrictionis True.enableRestriction(bool) - Whether to restrict API calls within the Service Perimeter to the list of APIs specified in ‘allowedServices’.
status: pulumi.Output[dict] = None¶ServicePerimeter configuration. Specifies sets of resources, restricted services and access levels that determine perimeter content and boundaries. Structure is documented below.
accessLevels(list) - A list of AccessLevel resource names that allow resources within the ServicePerimeter to be accessed from the internet. AccessLevels listed must be in the same policy as this ServicePerimeter. Referencing a nonexistent AccessLevel is a syntax error. If no AccessLevel names are listed, resources within the perimeter can only be accessed via GCP calls with request origins within the perimeter. For Service Perimeter Bridge, must be empty. Format: accessPolicies/{policy_id}/accessLevels/{access_level_name}resources(list) - A list of GCP resources that are inside of the service perimeter. Currently only projects are allowed. Format: projects/{project_number}restrictedServices(list) - GCP services that are subject to the Service Perimeter restrictions. Must contain a list of services. For example, ifstorage.googleapis.comis specified, access to the storage buckets inside the perimeter must meet the perimeter’s access restrictions.vpcAccessibleServices(dict) - Specifies how APIs are allowed to communicate within the Service Perimeter. Structure is documented below.allowedServices(list) - The list of APIs usable within the Service Perimeter. Must be empty unlessenableRestrictionis True.enableRestriction(bool) - Whether to restrict API calls within the Service Perimeter to the list of APIs specified in ‘allowedServices’.
title: pulumi.Output[str] = None¶Human readable title. Must be unique within the Policy.
update_time: pulumi.Output[str] = None¶Time the AccessPolicy was updated in UTC.
use_explicit_dry_run_spec: pulumi.Output[bool] = None¶Use explicit dry run spec flag. Ordinarily, a dry-run spec implicitly exists for all Service Perimeters, and that spec is identical to the status for those Service Perimeters. When this flag is set, it inhibits the generation of the implicit spec, thereby allowing the user to explicitly provide a configuration (“spec”) to use in a dry-run version of the Service Perimeter. This allows the user to test changes to the enforced config (“status”) without actually enforcing them. This testing is done through analyzing the differences between currently enforced and suggested restrictions. useExplicitDryRunSpec must bet set to True if any of the fields in the spec are set to non-default values.
- static
get(resource_name, id, opts=None, create_time=None, description=None, name=None, parent=None, perimeter_type=None, spec=None, status=None, title=None, update_time=None, use_explicit_dry_run_spec=None)¶ Get an existing ServicePerimeter resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
create_time (pulumi.Input[str]) – Time the AccessPolicy was created in UTC.
description (pulumi.Input[str]) – Description of the ServicePerimeter and its use. Does not affect behavior.
name (pulumi.Input[str]) – Resource name for the ServicePerimeter. The shortname component must begin with a letter and only include alphanumeric and ‘’. Format: accessPolicies/{policy_id}/servicePerimeters/{short_name}
parent (pulumi.Input[str]) – The AccessPolicy this ServicePerimeter lives in. Format: accessPolicies/{policy_id}
perimeter_type (pulumi.Input[str]) – Specifies the type of the Perimeter. There are two types: regular and bridge. Regular Service Perimeter contains resources, access levels, and restricted services. Every resource can be in at most ONE regular Service Perimeter. In addition to being in a regular service perimeter, a resource can also be in zero or more perimeter bridges. A perimeter bridge only contains resources. Cross project operations are permitted if all effected resources share some perimeter (whether bridge or regular). Perimeter Bridge does not contain access levels or services: those are governed entirely by the regular perimeter that resource is in. Perimeter Bridges are typically useful when building more complex topologies with many independent perimeters that need to share some data with a common perimeter, but should not be able to share data among themselves.
spec (pulumi.Input[dict]) – Proposed (or dry run) ServicePerimeter configuration. This configuration allows to specify and test ServicePerimeter configuration without enforcing actual access restrictions. Only allowed to be set when the
useExplicitDryRunSpecflag is set. Structure is documented below.status (pulumi.Input[dict]) – ServicePerimeter configuration. Specifies sets of resources, restricted services and access levels that determine perimeter content and boundaries. Structure is documented below.
title (pulumi.Input[str]) – Human readable title. Must be unique within the Policy.
update_time (pulumi.Input[str]) – Time the AccessPolicy was updated in UTC.
use_explicit_dry_run_spec (pulumi.Input[bool]) – Use explicit dry run spec flag. Ordinarily, a dry-run spec implicitly exists for all Service Perimeters, and that spec is identical to the status for those Service Perimeters. When this flag is set, it inhibits the generation of the implicit spec, thereby allowing the user to explicitly provide a configuration (“spec”) to use in a dry-run version of the Service Perimeter. This allows the user to test changes to the enforced config (“status”) without actually enforcing them. This testing is done through analyzing the differences between currently enforced and suggested restrictions. useExplicitDryRunSpec must bet set to True if any of the fields in the spec are set to non-default values.
The spec object supports the following:
accessLevels(pulumi.Input[list]) - A list of AccessLevel resource names that allow resources within the ServicePerimeter to be accessed from the internet. AccessLevels listed must be in the same policy as this ServicePerimeter. Referencing a nonexistent AccessLevel is a syntax error. If no AccessLevel names are listed, resources within the perimeter can only be accessed via GCP calls with request origins within the perimeter. For Service Perimeter Bridge, must be empty. Format: accessPolicies/{policy_id}/accessLevels/{access_level_name}resources(pulumi.Input[list]) - A list of GCP resources that are inside of the service perimeter. Currently only projects are allowed. Format: projects/{project_number}restrictedServices(pulumi.Input[list]) - GCP services that are subject to the Service Perimeter restrictions. Must contain a list of services. For example, ifstorage.googleapis.comis specified, access to the storage buckets inside the perimeter must meet the perimeter’s access restrictions.vpcAccessibleServices(pulumi.Input[dict]) - Specifies how APIs are allowed to communicate within the Service Perimeter. Structure is documented below.allowedServices(pulumi.Input[list]) - The list of APIs usable within the Service Perimeter. Must be empty unlessenableRestrictionis True.enableRestriction(pulumi.Input[bool]) - Whether to restrict API calls within the Service Perimeter to the list of APIs specified in ‘allowedServices’.
The status object supports the following:
accessLevels(pulumi.Input[list]) - A list of AccessLevel resource names that allow resources within the ServicePerimeter to be accessed from the internet. AccessLevels listed must be in the same policy as this ServicePerimeter. Referencing a nonexistent AccessLevel is a syntax error. If no AccessLevel names are listed, resources within the perimeter can only be accessed via GCP calls with request origins within the perimeter. For Service Perimeter Bridge, must be empty. Format: accessPolicies/{policy_id}/accessLevels/{access_level_name}resources(pulumi.Input[list]) - A list of GCP resources that are inside of the service perimeter. Currently only projects are allowed. Format: projects/{project_number}restrictedServices(pulumi.Input[list]) - GCP services that are subject to the Service Perimeter restrictions. Must contain a list of services. For example, ifstorage.googleapis.comis specified, access to the storage buckets inside the perimeter must meet the perimeter’s access restrictions.vpcAccessibleServices(pulumi.Input[dict]) - Specifies how APIs are allowed to communicate within the Service Perimeter. Structure is documented below.allowedServices(pulumi.Input[list]) - The list of APIs usable within the Service Perimeter. Must be empty unlessenableRestrictionis True.enableRestriction(pulumi.Input[bool]) - Whether to restrict API calls within the Service Perimeter to the list of APIs specified in ‘allowedServices’.
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
- class
pulumi_gcp.accesscontextmanager.ServicePerimeterResource(resource_name, opts=None, perimeter_name=None, resource=None, __props__=None, __name__=None, __opts__=None)¶ Allows configuring a single GCP resource that should be inside of a service perimeter. This resource is intended to be used in cases where it is not possible to compile a full list of projects to include in a
accesscontextmanager.ServicePerimeterresource, to enable them to be added separately.Note: If this resource is used alongside a
accesscontextmanager.ServicePerimeterresource, the service perimeter resource must have alifecycleblock withignore_changes = [status[0].resources]so they don’t fight over which resources should be in the policy.To get more information about ServicePerimeterResource, see:
How-to Guides
import pulumi import pulumi_gcp as gcp access_policy = gcp.accesscontextmanager.AccessPolicy("access-policy", parent="organizations/123456789", title="my policy") service_perimeter_resource_service_perimeter = gcp.accesscontextmanager.ServicePerimeter("service-perimeter-resourceServicePerimeter", parent=access_policy.name.apply(lambda name: f"accessPolicies/{name}"), title="restrict_all", status={ "restrictedServices": ["storage.googleapis.com"], }) service_perimeter_resource_service_perimeter_resource = gcp.accesscontextmanager.ServicePerimeterResource("service-perimeter-resourceServicePerimeterResource", perimeter_name=service_perimeter_resource_service_perimeter.name, resource="projects/987654321")
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
perimeter_name (pulumi.Input[str]) – The name of the Service Perimeter to add this resource to.
resource (pulumi.Input[str]) – A GCP resource that is inside of the service perimeter. Currently only projects are allowed. Format: projects/{project_number}
perimeter_name: pulumi.Output[str] = None¶The name of the Service Perimeter to add this resource to.
resource: pulumi.Output[str] = None¶A GCP resource that is inside of the service perimeter. Currently only projects are allowed. Format: projects/{project_number}
- static
get(resource_name, id, opts=None, perimeter_name=None, resource=None)¶ Get an existing ServicePerimeterResource resource’s state with the given name, id, and optional extra properties used to qualify the lookup.
- Parameters
resource_name (str) – The unique name of the resulting resource.
id (str) – The unique provider ID of the resource to lookup.
opts (pulumi.ResourceOptions) – Options for the resource.
perimeter_name (pulumi.Input[str]) – The name of the Service Perimeter to add this resource to.
resource (pulumi.Input[str]) – A GCP resource that is inside of the service perimeter. Currently only projects are allowed. Format: projects/{project_number}
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str