Skip to content

Commit bbb3c1f

Browse files
Google APIscopybara-github
authored andcommitted
feat: Deprecates AlternativePolicySpec
PiperOrigin-RevId: 428897918
1 parent 3f75ee1 commit bbb3c1f

2 files changed

Lines changed: 35 additions & 35 deletions

File tree

google/cloud/orgpolicy/v2/constraint.proto

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -31,11 +31,11 @@ option ruby_package = "Google::Cloud::OrgPolicy::V2";
3131
// example, you could enforce a constraint that controls which cloud services
3232
// can be activated across an organization, or whether a Compute Engine instance
3333
// can have serial port connections established. `Constraints` can be configured
34-
// by the organization's policy adminstrator to fit the needs of the organzation
35-
// by setting a `policy` that includes `constraints` at different locations in
36-
// the organization's resource hierarchy. Policies are inherited down the
37-
// resource hierarchy from higher levels, but can also be overridden. For
38-
// details about the inheritance rules please read about
34+
// by the organization's policy administrator to fit the needs of the
35+
// organization by setting a `policy` that includes `constraints` at different
36+
// locations in the organization's resource hierarchy. Policies are inherited
37+
// down the resource hierarchy from higher levels, but can also be overridden.
38+
// For details about the inheritance rules please read about
3939
// [`policies`][google.cloud.OrgPolicy.v2.Policy].
4040
//
4141
// `Constraints` have a default behavior determined by the `constraint_default`
@@ -49,6 +49,24 @@ message Constraint {
4949
pattern: "organizations/{organization}/constraints/{constraint}"
5050
};
5151

52+
// Specifies the default behavior in the absence of any `Policy` for the
53+
// `Constraint`. This must not be `CONSTRAINT_DEFAULT_UNSPECIFIED`.
54+
//
55+
// Immutable after creation.
56+
enum ConstraintDefault {
57+
// This is only used for distinguishing unset values and should never be
58+
// used.
59+
CONSTRAINT_DEFAULT_UNSPECIFIED = 0;
60+
61+
// Indicate that all values are allowed for list constraints.
62+
// Indicate that enforcement is off for boolean constraints.
63+
ALLOW = 1;
64+
65+
// Indicate that all values are denied for list constraints.
66+
// Indicate that enforcement is on for boolean constraints.
67+
DENY = 2;
68+
}
69+
5270
// A `Constraint` that allows or disallows a list of string values, which are
5371
// configured by an Organization's policy administrator with a `Policy`.
5472
message ListConstraint {
@@ -73,24 +91,6 @@ message Constraint {
7391

7492
}
7593

76-
// Specifies the default behavior in the absence of any `Policy` for the
77-
// `Constraint`. This must not be `CONSTRAINT_DEFAULT_UNSPECIFIED`.
78-
//
79-
// Immutable after creation.
80-
enum ConstraintDefault {
81-
// This is only used for distinguishing unset values and should never be
82-
// used.
83-
CONSTRAINT_DEFAULT_UNSPECIFIED = 0;
84-
85-
// Indicate that all values are allowed for list constraints.
86-
// Indicate that enforcement is off for boolean constraints.
87-
ALLOW = 1;
88-
89-
// Indicate that all values are denied for list constraints.
90-
// Indicate that enforcement is on for boolean constraints.
91-
DENY = 2;
92-
}
93-
9494
// Immutable. The resource name of the Constraint. Must be in one of
9595
// the following forms:
9696
// * `projects/{project_number}/constraints/{constraint_name}`

google/cloud/orgpolicy/v2/orgpolicy.proto

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -214,11 +214,8 @@ message Policy {
214214
// Basic information about the Organization Policy.
215215
PolicySpec spec = 2;
216216

217-
// An alternate policy configuration that will be used instead of the baseline
218-
// policy configurations as determined by the launch.
219-
// Currently the only way the launch can trigger the alternate configuration
220-
// is via dry-run/darklaunch.
221-
AlternatePolicySpec alternate = 3;
217+
// Deprecated.
218+
AlternatePolicySpec alternate = 3 [deprecated = true];
222219
}
223220

224221
// Similar to PolicySpec but with an extra 'launch' field for launch reference.
@@ -284,11 +281,14 @@ message PolicySpec {
284281
// in the evaluation of the policy. When set, the `expression` field in
285282
// the `Expr' must include from 1 to 10 subexpressions, joined by the "||"
286283
// or "&&" operators. Each subexpression must be of the form
287-
// "resource.matchLabels(key_name, value_name)",
288-
// where key_name and value_name are the resource names for Label Keys
289-
// and Values. These names are available from the Label Manager Service. An
290-
// example expression is:
291-
// "resource.matchLabels('labelKeys/123, 'labelValues/456')".
284+
// "resource.matchTag('<ORG_ID>/tag_key_short_name,
285+
// 'tag_value_short_name')". or "resource.matchTagId('tagKeys/key_id',
286+
// 'tagValues/value_id')". where key_name and value_name are the resource
287+
// names for Label Keys and Values. These names are available from the Tag
288+
// Manager Service. An example expression is:
289+
// "resource.matchTag('123456789/environment,
290+
// 'prod')". or "resource.matchTagId('tagKeys/123',
291+
// 'tagValues/456')".
292292
google.type.Expr condition = 5;
293293
}
294294

0 commit comments

Comments
 (0)