@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
440 lines • 18.9 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* PolicyOrchestrator helps managing project+zone level policy resources (e.g.
* OS Policy Assignments), by providing tools to create, update and delete them
* across projects and locations, at scale.
*
* ## Example Usage
*
* ### Osconfigv2 Policy Orchestrator For Folder Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* import * as time from "@pulumiverse/time";
*
* const myFolder = new gcp.organizations.Folder("my_folder", {
* displayName: "po-folder",
* parent: "organizations/123456789",
* deletionProtection: false,
* });
* const osconfigSa = new gcp.folder.ServiceIdentity("osconfig_sa", {
* folder: myFolder.folderId,
* service: "osconfig.googleapis.com",
* });
* const rippleSa = new gcp.folder.ServiceIdentity("ripple_sa", {
* folder: myFolder.folderId,
* service: "progressiverollout.googleapis.com",
* });
* const wait30Sec = new time.Sleep("wait_30_sec", {createDuration: "30s"}, {
* dependsOn: [
* osconfigSa,
* rippleSa,
* ],
* });
* const iamOsconfigServiceAgent = new gcp.folder.IAMMember("iam_osconfig_service_agent", {
* folder: myFolder.folderId,
* role: "roles/osconfig.serviceAgent",
* member: osconfigSa.member,
* }, {
* dependsOn: [wait30Sec],
* });
* const iamOsconfigRolloutServiceAgent = new gcp.folder.IAMMember("iam_osconfig_rollout_service_agent", {
* folder: myFolder.folderId,
* role: "roles/osconfig.rolloutServiceAgent",
* member: pulumi.interpolate`serviceAccount:service-folder-${myFolder.folderId}@gcp-sa-osconfig-rollout.iam.gserviceaccount.com`,
* }, {
* dependsOn: [iamOsconfigServiceAgent],
* });
* const iamProgressiverolloutServiceAgent = new gcp.folder.IAMMember("iam_progressiverollout_service_agent", {
* folder: myFolder.folderId,
* role: "roles/progressiverollout.serviceAgent",
* member: rippleSa.member,
* }, {
* dependsOn: [iamOsconfigRolloutServiceAgent],
* });
* const wait3Min = new time.Sleep("wait_3_min", {createDuration: "180s"}, {
* dependsOn: [iamProgressiverolloutServiceAgent],
* });
* const policyOrchestratorForFolder = new gcp.osconfig.V2PolicyOrchestratorForFolder("policy_orchestrator_for_folder", {
* policyOrchestratorId: "po-folder",
* folderId: myFolder.folderId,
* state: "ACTIVE",
* action: "UPSERT",
* orchestratedResource: {
* id: "test-orchestrated-resource-folder",
* osPolicyAssignmentV1Payload: {
* osPolicies: [{
* id: "test-os-policy-folder",
* mode: "VALIDATION",
* resourceGroups: [{
* resources: [{
* id: "resource-tf",
* file: {
* content: "file-content-tf",
* path: "file-path-tf-1",
* state: "PRESENT",
* },
* }],
* }],
* }],
* instanceFilter: {
* inventories: [{
* osShortName: "windows-10",
* }],
* },
* rollout: {
* disruptionBudget: {
* percent: 100,
* },
* minWaitDuration: "60s",
* },
* },
* },
* labels: {
* state: "active",
* },
* orchestrationScope: {
* selectors: [{
* locationSelector: {
* includedLocations: [""],
* },
* }],
* },
* }, {
* dependsOn: [wait3Min],
* });
* ```
*
* ## Import
*
* PolicyOrchestratorForFolder can be imported using any of these accepted formats:
*
* * `folders/{{folder_id}}/locations/global/policyOrchestrators/{{policy_orchestrator_id}}`
* * `{{folder_id}}/{{policy_orchestrator_id}}`
*
* When using the `pulumi import` command, PolicyOrchestratorForFolder can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:osconfig/v2PolicyOrchestratorForFolder:V2PolicyOrchestratorForFolder default folders/{{folder_id}}/locations/global/policyOrchestrators/{{policy_orchestrator_id}}
* $ pulumi import gcp:osconfig/v2PolicyOrchestratorForFolder:V2PolicyOrchestratorForFolder default {{folder_id}}/{{policy_orchestrator_id}}
* ```
*/
export declare class V2PolicyOrchestratorForFolder extends pulumi.CustomResource {
/**
* Get an existing V2PolicyOrchestratorForFolder resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: V2PolicyOrchestratorForFolderState, opts?: pulumi.CustomResourceOptions): V2PolicyOrchestratorForFolder;
/**
* Returns true if the given object is an instance of V2PolicyOrchestratorForFolder. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is V2PolicyOrchestratorForFolder;
/**
* Action to be done by the orchestrator in
* `projects/{project_id}/zones/{zone_id}` locations defined by the
* `orchestrationScope`. Allowed values:
* - `UPSERT` - Orchestrator will create or update target resources.
* - `DELETE` - Orchestrator will delete target resources, if they exist
*/
readonly action: pulumi.Output<string>;
/**
* Timestamp when the policy orchestrator resource was created.
*/
readonly createTime: pulumi.Output<string>;
/**
* Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
* When a 'terraform destroy' or 'pulumi up' would delete the resource,
* the command will fail if this field is set to "PREVENT" in Terraform state.
* When set to "ABANDON", the command will remove the resource from Terraform
* management without updating or deleting the resource in the API.
* When set to "DELETE", deleting the resource is allowed.
*/
readonly deletionPolicy: pulumi.Output<string>;
/**
* Freeform text describing the purpose of the resource.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
*/
readonly effectiveLabels: pulumi.Output<{
[key: string]: string;
}>;
/**
* This checksum is computed by the server based on the value of other
* fields, and may be sent on update and delete requests to ensure the
* client has an up-to-date value before proceeding.
*/
readonly etag: pulumi.Output<string>;
/**
* The parent resource name in the form of `folders/{folder_id}/locations/global`.
*/
readonly folderId: pulumi.Output<string>;
/**
* Labels as key value pairs
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field `effectiveLabels` for all of the labels present on the resource.
*/
readonly labels: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* Identifier. In form of
* * `organizations/{organization_id}/locations/global/policyOrchestrators/{orchestrator_id}`
* * `folders/{folder_id}/locations/global/policyOrchestrators/{orchestrator_id}`
* * `projects/{project_id_or_number}/locations/global/policyOrchestrators/{orchestrator_id}`
*/
readonly name: pulumi.Output<string>;
/**
* Represents a resource that is being orchestrated by the policy orchestrator.
* Structure is documented below.
*/
readonly orchestratedResource: pulumi.Output<outputs.osconfig.V2PolicyOrchestratorForFolderOrchestratedResource>;
/**
* Defines a set of selectors which drive which resources are in scope of policy
* orchestration.
* Structure is documented below.
*/
readonly orchestrationScope: pulumi.Output<outputs.osconfig.V2PolicyOrchestratorForFolderOrchestrationScope | undefined>;
/**
* Describes the state of the orchestration process.
* Structure is documented below.
*/
readonly orchestrationStates: pulumi.Output<outputs.osconfig.V2PolicyOrchestratorForFolderOrchestrationState[]>;
/**
* The logical identifier of the policy orchestrator, with the following
* restrictions:
* * Must contain only lowercase letters, numbers, and hyphens.
* * Must start with a letter.
* * Must be between 1-63 characters.
* * Must end with a number or a letter.
* * Must be unique within the parent.
*/
readonly policyOrchestratorId: pulumi.Output<string>;
/**
* The combination of labels configured directly on the resource
* and default labels configured on the provider.
*/
readonly pulumiLabels: pulumi.Output<{
[key: string]: string;
}>;
/**
* Set to true, if the there are ongoing changes being applied by the
* orchestrator.
*/
readonly reconciling: pulumi.Output<boolean>;
/**
* State of the orchestrator. Can be updated to change orchestrator behaviour.
* Allowed values:
* - `ACTIVE` - orchestrator is actively looking for actions to be taken.
* - `STOPPED` - orchestrator won't make any changes.
* Note: There might be more states added in the future. We use string here
* instead of an enum, to avoid the need of propagating new states to all the
* client code.
*/
readonly state: pulumi.Output<string | undefined>;
/**
* Timestamp when the policy orchestrator resource was last modified.
*/
readonly updateTime: pulumi.Output<string>;
/**
* Create a V2PolicyOrchestratorForFolder resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: V2PolicyOrchestratorForFolderArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering V2PolicyOrchestratorForFolder resources.
*/
export interface V2PolicyOrchestratorForFolderState {
/**
* Action to be done by the orchestrator in
* `projects/{project_id}/zones/{zone_id}` locations defined by the
* `orchestrationScope`. Allowed values:
* - `UPSERT` - Orchestrator will create or update target resources.
* - `DELETE` - Orchestrator will delete target resources, if they exist
*/
action?: pulumi.Input<string | undefined>;
/**
* Timestamp when the policy orchestrator resource was created.
*/
createTime?: pulumi.Input<string | undefined>;
/**
* Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
* When a 'terraform destroy' or 'pulumi up' would delete the resource,
* the command will fail if this field is set to "PREVENT" in Terraform state.
* When set to "ABANDON", the command will remove the resource from Terraform
* management without updating or deleting the resource in the API.
* When set to "DELETE", deleting the resource is allowed.
*/
deletionPolicy?: pulumi.Input<string | undefined>;
/**
* Freeform text describing the purpose of the resource.
*/
description?: pulumi.Input<string | undefined>;
/**
* All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
*/
effectiveLabels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
} | undefined>;
/**
* This checksum is computed by the server based on the value of other
* fields, and may be sent on update and delete requests to ensure the
* client has an up-to-date value before proceeding.
*/
etag?: pulumi.Input<string | undefined>;
/**
* The parent resource name in the form of `folders/{folder_id}/locations/global`.
*/
folderId?: pulumi.Input<string | undefined>;
/**
* Labels as key value pairs
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field `effectiveLabels` for all of the labels present on the resource.
*/
labels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
} | undefined>;
/**
* Identifier. In form of
* * `organizations/{organization_id}/locations/global/policyOrchestrators/{orchestrator_id}`
* * `folders/{folder_id}/locations/global/policyOrchestrators/{orchestrator_id}`
* * `projects/{project_id_or_number}/locations/global/policyOrchestrators/{orchestrator_id}`
*/
name?: pulumi.Input<string | undefined>;
/**
* Represents a resource that is being orchestrated by the policy orchestrator.
* Structure is documented below.
*/
orchestratedResource?: pulumi.Input<inputs.osconfig.V2PolicyOrchestratorForFolderOrchestratedResource | undefined>;
/**
* Defines a set of selectors which drive which resources are in scope of policy
* orchestration.
* Structure is documented below.
*/
orchestrationScope?: pulumi.Input<inputs.osconfig.V2PolicyOrchestratorForFolderOrchestrationScope | undefined>;
/**
* Describes the state of the orchestration process.
* Structure is documented below.
*/
orchestrationStates?: pulumi.Input<pulumi.Input<inputs.osconfig.V2PolicyOrchestratorForFolderOrchestrationState>[] | undefined>;
/**
* The logical identifier of the policy orchestrator, with the following
* restrictions:
* * Must contain only lowercase letters, numbers, and hyphens.
* * Must start with a letter.
* * Must be between 1-63 characters.
* * Must end with a number or a letter.
* * Must be unique within the parent.
*/
policyOrchestratorId?: pulumi.Input<string | undefined>;
/**
* The combination of labels configured directly on the resource
* and default labels configured on the provider.
*/
pulumiLabels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
} | undefined>;
/**
* Set to true, if the there are ongoing changes being applied by the
* orchestrator.
*/
reconciling?: pulumi.Input<boolean | undefined>;
/**
* State of the orchestrator. Can be updated to change orchestrator behaviour.
* Allowed values:
* - `ACTIVE` - orchestrator is actively looking for actions to be taken.
* - `STOPPED` - orchestrator won't make any changes.
* Note: There might be more states added in the future. We use string here
* instead of an enum, to avoid the need of propagating new states to all the
* client code.
*/
state?: pulumi.Input<string | undefined>;
/**
* Timestamp when the policy orchestrator resource was last modified.
*/
updateTime?: pulumi.Input<string | undefined>;
}
/**
* The set of arguments for constructing a V2PolicyOrchestratorForFolder resource.
*/
export interface V2PolicyOrchestratorForFolderArgs {
/**
* Action to be done by the orchestrator in
* `projects/{project_id}/zones/{zone_id}` locations defined by the
* `orchestrationScope`. Allowed values:
* - `UPSERT` - Orchestrator will create or update target resources.
* - `DELETE` - Orchestrator will delete target resources, if they exist
*/
action: pulumi.Input<string>;
/**
* Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
* When a 'terraform destroy' or 'pulumi up' would delete the resource,
* the command will fail if this field is set to "PREVENT" in Terraform state.
* When set to "ABANDON", the command will remove the resource from Terraform
* management without updating or deleting the resource in the API.
* When set to "DELETE", deleting the resource is allowed.
*/
deletionPolicy?: pulumi.Input<string | undefined>;
/**
* Freeform text describing the purpose of the resource.
*/
description?: pulumi.Input<string | undefined>;
/**
* The parent resource name in the form of `folders/{folder_id}/locations/global`.
*/
folderId: pulumi.Input<string>;
/**
* Labels as key value pairs
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field `effectiveLabels` for all of the labels present on the resource.
*/
labels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
} | undefined>;
/**
* Represents a resource that is being orchestrated by the policy orchestrator.
* Structure is documented below.
*/
orchestratedResource: pulumi.Input<inputs.osconfig.V2PolicyOrchestratorForFolderOrchestratedResource>;
/**
* Defines a set of selectors which drive which resources are in scope of policy
* orchestration.
* Structure is documented below.
*/
orchestrationScope?: pulumi.Input<inputs.osconfig.V2PolicyOrchestratorForFolderOrchestrationScope | undefined>;
/**
* The logical identifier of the policy orchestrator, with the following
* restrictions:
* * Must contain only lowercase letters, numbers, and hyphens.
* * Must start with a letter.
* * Must be between 1-63 characters.
* * Must end with a number or a letter.
* * Must be unique within the parent.
*/
policyOrchestratorId: pulumi.Input<string>;
/**
* State of the orchestrator. Can be updated to change orchestrator behaviour.
* Allowed values:
* - `ACTIVE` - orchestrator is actively looking for actions to be taken.
* - `STOPPED` - orchestrator won't make any changes.
* Note: There might be more states added in the future. We use string here
* instead of an enum, to avoid the need of propagating new states to all the
* client code.
*/
state?: pulumi.Input<string | undefined>;
}
//# sourceMappingURL=v2policyOrchestratorForFolder.d.ts.map