Class ServicePerimeter
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:
- API documentation
- How-to Guides
- Service Perimeter Quickstart
Example Usage - Access Context Manager Service Perimeter Basic
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var access_policy = new Gcp.AccessContextManager.AccessPolicy("access-policy", new Gcp.AccessContextManager.AccessPolicyArgs
{
Parent = "organizations/123456789",
Title = "my policy",
});
var service_perimeter = new Gcp.AccessContextManager.ServicePerimeter("service-perimeter", new Gcp.AccessContextManager.ServicePerimeterArgs
{
Parent = access_policy.Name.Apply(name => $"accessPolicies/{name}"),
Status = new Gcp.AccessContextManager.Inputs.ServicePerimeterStatusArgs
{
RestrictedServices =
{
"storage.googleapis.com",
},
},
Title = "restrict_storage",
});
var access_level = new Gcp.AccessContextManager.AccessLevel("access-level", new Gcp.AccessContextManager.AccessLevelArgs
{
Basic = new Gcp.AccessContextManager.Inputs.AccessLevelBasicArgs
{
Conditions =
{
new Gcp.AccessContextManager.Inputs.AccessLevelBasicConditionArgs
{
DevicePolicy = new Gcp.AccessContextManager.Inputs.AccessLevelBasicConditionDevicePolicyArgs
{
OsConstraints =
{
new Gcp.AccessContextManager.Inputs.AccessLevelBasicConditionDevicePolicyOsConstraintArgs
{
OsType = "DESKTOP_CHROME_OS",
},
},
RequireScreenLock = false,
},
Regions =
{
"CH",
"IT",
"US",
},
},
},
},
Parent = access_policy.Name.Apply(name => $"accessPolicies/{name}"),
Title = "chromeos_no_lock",
});
}
}
Example Usage - Access Context Manager Service Perimeter Dry Run
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var access_policy = new Gcp.AccessContextManager.AccessPolicy("access-policy", new Gcp.AccessContextManager.AccessPolicyArgs
{
Parent = "organizations/123456789",
Title = "my policy",
});
var service_perimeter = new Gcp.AccessContextManager.ServicePerimeter("service-perimeter", new Gcp.AccessContextManager.ServicePerimeterArgs
{
Parent = access_policy.Name.Apply(name => $"accessPolicies/{name}"),
Spec = new Gcp.AccessContextManager.Inputs.ServicePerimeterSpecArgs
{
RestrictedServices =
{
"storage.googleapis.com",
},
},
Status = new Gcp.AccessContextManager.Inputs.ServicePerimeterStatusArgs
{
RestrictedServices =
{
"bigquery.googleapis.com",
},
},
Title = "restrict_bigquery_dryrun_storage",
UseExplicitDryRunSpec = true,
});
}
}
Inherited Members
Namespace: Pulumi.Gcp.AccessContextManager
Assembly: Pulumi.Gcp.dll
Syntax
public class ServicePerimeter : CustomResource
Constructors
View SourceServicePerimeter(String, ServicePerimeterArgs, CustomResourceOptions)
Create a ServicePerimeter resource with the given unique name, arguments, and options.
Declaration
public ServicePerimeter(string name, ServicePerimeterArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| ServicePerimeterArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceCreateTime
Time the AccessPolicy was created in UTC.
Declaration
public Output<string> CreateTime { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Description
Description of the ServicePerimeter and its use. Does not affect behavior.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Name
Resource name for the ServicePerimeter. The short_name component must begin with a letter and only include alphanumeric and '_'. Format: accessPolicies/{policy_id}/servicePerimeters/{short_name}
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Parent
The AccessPolicy this ServicePerimeter lives in. Format: accessPolicies/{policy_id}
Declaration
public Output<string> Parent { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
PerimeterType
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.
Declaration
public Output<string> PerimeterType { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Spec
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 useExplicitDryRunSpec flag is set. Structure is documented below.
Declaration
public Output<ServicePerimeterSpec> Spec { get; }
Property Value
| Type | Description |
|---|---|
| Output<ServicePerimeterSpec> |
Status
ServicePerimeter configuration. Specifies sets of resources, restricted services and access levels that determine perimeter content and boundaries. Structure is documented below.
Declaration
public Output<ServicePerimeterStatus> Status { get; }
Property Value
| Type | Description |
|---|---|
| Output<ServicePerimeterStatus> |
Title
Human readable title. Must be unique within the Policy.
Declaration
public Output<string> Title { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
UpdateTime
Time the AccessPolicy was updated in UTC.
Declaration
public Output<string> UpdateTime { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
UseExplicitDryRunSpec
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.
Declaration
public Output<bool?> UseExplicitDryRunSpec { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Methods
View SourceGet(String, Input<String>, ServicePerimeterState, CustomResourceOptions)
Get an existing ServicePerimeter resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static ServicePerimeter Get(string name, Input<string> id, ServicePerimeterState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| ServicePerimeterState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| ServicePerimeter |