@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
363 lines (362 loc) • 13.6 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* OS policy assignment is an API resource that is used to apply a set of OS
* policies to a dynamically targeted group of Compute Engine VM instances. An OS
* policy is used to define the desired state configuration for a Compute Engine VM
* instance through a set of configuration resources that provide capabilities such
* as installing or removing software packages, or executing a script. For more
* information about the OS policy resource definitions and examples, see
* [OS policy and OS policy assignment](https://cloud.google.com/compute/docs/os-configuration-management/working-with-os-policies).
*
* To get more information about OSPolicyAssignment, see:
*
* * [API documentation](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments)
* * How-to Guides
* * [Official Documentation](https://cloud.google.com/compute/docs/os-configuration-management/create-os-policy-assignment)
*
* ## Example Usage
*
* ### Os Config Os Policy Assignment Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const primary = new gcp.osconfig.OsPolicyAssignment("primary", {
* instanceFilter: {
* all: false,
* exclusionLabels: [{
* labels: {
* "label-two": "value-two",
* },
* }],
* inclusionLabels: [{
* labels: {
* "label-one": "value-one",
* },
* }],
* inventories: [{
* osShortName: "centos",
* osVersion: "8.*",
* }],
* },
* location: "us-central1-a",
* name: "policy-assignment",
* osPolicies: [{
* id: "policy",
* mode: "VALIDATION",
* resourceGroups: [{
* resources: [
* {
* id: "apt-to-yum",
* repository: {
* apt: {
* archiveType: "DEB",
* components: ["doc"],
* distribution: "debian",
* uri: "https://atl.mirrors.clouvider.net/debian",
* gpgKey: ".gnupg/pubring.kbx",
* },
* },
* },
* {
* id: "exec1",
* exec: {
* validate: {
* interpreter: "SHELL",
* args: ["arg1"],
* file: {
* localPath: "$HOME/script.sh",
* },
* outputFilePath: "$HOME/out",
* },
* enforce: {
* interpreter: "SHELL",
* args: ["arg1"],
* file: {
* allowInsecure: true,
* remote: {
* uri: "https://www.example.com/script.sh",
* sha256Checksum: "c7938fed83afdccbb0e86a2a2e4cad7d5035012ca3214b4a61268393635c3063",
* },
* },
* outputFilePath: "$HOME/out",
* },
* },
* },
* ],
* inventoryFilters: [{
* osShortName: "centos",
* osVersion: "8.*",
* }],
* }],
* allowNoResourceGroupMatch: false,
* description: "A test os policy",
* }],
* rollout: {
* disruptionBudget: {
* percent: 100,
* },
* minWaitDuration: "3s",
* },
* description: "A test os policy assignment",
* });
* ```
*
* ## Import
*
* OSPolicyAssignment can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/osPolicyAssignments/{{name}}`
*
* * `{{project}}/{{location}}/{{name}}`
*
* * `{{location}}/{{name}}`
*
* When using the `pulumi import` command, OSPolicyAssignment can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:osconfig/osPolicyAssignment:OsPolicyAssignment default projects/{{project}}/locations/{{location}}/osPolicyAssignments/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:osconfig/osPolicyAssignment:OsPolicyAssignment default {{project}}/{{location}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:osconfig/osPolicyAssignment:OsPolicyAssignment default {{location}}/{{name}}
* ```
*/
export declare class OsPolicyAssignment extends pulumi.CustomResource {
/**
* Get an existing OsPolicyAssignment 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?: OsPolicyAssignmentState, opts?: pulumi.CustomResourceOptions): OsPolicyAssignment;
/**
* Returns true if the given object is an instance of OsPolicyAssignment. 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 OsPolicyAssignment;
/**
* Output only. Indicates that this revision has been successfully
* rolled out in this zone and new VMs will be assigned OS policies from this
* revision. For a given OS policy assignment, there is only one revision with
* a value of `true` for this field.
*/
readonly baseline: pulumi.Output<boolean>;
/**
* Output only. Indicates that this revision deletes the OS policy
* assignment.
*/
readonly deleted: pulumi.Output<boolean>;
/**
* OS policy assignment description. Length of the description is limited to 1024 characters.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* The etag for this OS policy assignment. If this is provided on
* update, it must match the server's etag.
*/
readonly etag: pulumi.Output<string>;
/**
* Filter to select VMs. Structure is
* documented below.
*/
readonly instanceFilter: pulumi.Output<outputs.osconfig.OsPolicyAssignmentInstanceFilter>;
/**
* The location for the resource
*/
readonly location: pulumi.Output<string>;
/**
* Resource name.
*/
readonly name: pulumi.Output<string>;
/**
* List of OS policies to be applied to the VMs.
* Structure is documented below.
*/
readonly osPolicies: pulumi.Output<outputs.osconfig.OsPolicyAssignmentOsPolicy[]>;
/**
* The project for the resource
*/
readonly project: pulumi.Output<string>;
/**
* Output only. Indicates that reconciliation is in progress
* for the revision. This value is `true` when the `rolloutState` is one of:
*/
readonly reconciling: pulumi.Output<boolean>;
/**
* Output only. The timestamp that the revision was
* created.
*/
readonly revisionCreateTime: pulumi.Output<string>;
/**
* Output only. The assignment revision ID A new revision is
* committed whenever a rollout is triggered for a OS policy assignment
*/
readonly revisionId: pulumi.Output<string>;
/**
* Rollout to deploy the OS policy assignment. A rollout
* is triggered in the following situations: 1) OSPolicyAssignment is created.
* 2) OSPolicyAssignment is updated and the update contains changes to one of
* the following fields: - instanceFilter - osPolicies 3) OSPolicyAssignment
* is deleted. Structure is documented below.
*/
readonly rollout: pulumi.Output<outputs.osconfig.OsPolicyAssignmentRollout>;
/**
* Output only. OS policy assignment rollout state
*/
readonly rolloutState: pulumi.Output<string>;
/**
* Set to true to skip awaiting rollout during resource creation and update.
*/
readonly skipAwaitRollout: pulumi.Output<boolean | undefined>;
/**
* Output only. Server generated unique id for the OS policy assignment
* resource.
*/
readonly uid: pulumi.Output<string>;
/**
* Create a OsPolicyAssignment 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: OsPolicyAssignmentArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering OsPolicyAssignment resources.
*/
export interface OsPolicyAssignmentState {
/**
* Output only. Indicates that this revision has been successfully
* rolled out in this zone and new VMs will be assigned OS policies from this
* revision. For a given OS policy assignment, there is only one revision with
* a value of `true` for this field.
*/
baseline?: pulumi.Input<boolean>;
/**
* Output only. Indicates that this revision deletes the OS policy
* assignment.
*/
deleted?: pulumi.Input<boolean>;
/**
* OS policy assignment description. Length of the description is limited to 1024 characters.
*/
description?: pulumi.Input<string>;
/**
* The etag for this OS policy assignment. If this is provided on
* update, it must match the server's etag.
*/
etag?: pulumi.Input<string>;
/**
* Filter to select VMs. Structure is
* documented below.
*/
instanceFilter?: pulumi.Input<inputs.osconfig.OsPolicyAssignmentInstanceFilter>;
/**
* The location for the resource
*/
location?: pulumi.Input<string>;
/**
* Resource name.
*/
name?: pulumi.Input<string>;
/**
* List of OS policies to be applied to the VMs.
* Structure is documented below.
*/
osPolicies?: pulumi.Input<pulumi.Input<inputs.osconfig.OsPolicyAssignmentOsPolicy>[]>;
/**
* The project for the resource
*/
project?: pulumi.Input<string>;
/**
* Output only. Indicates that reconciliation is in progress
* for the revision. This value is `true` when the `rolloutState` is one of:
*/
reconciling?: pulumi.Input<boolean>;
/**
* Output only. The timestamp that the revision was
* created.
*/
revisionCreateTime?: pulumi.Input<string>;
/**
* Output only. The assignment revision ID A new revision is
* committed whenever a rollout is triggered for a OS policy assignment
*/
revisionId?: pulumi.Input<string>;
/**
* Rollout to deploy the OS policy assignment. A rollout
* is triggered in the following situations: 1) OSPolicyAssignment is created.
* 2) OSPolicyAssignment is updated and the update contains changes to one of
* the following fields: - instanceFilter - osPolicies 3) OSPolicyAssignment
* is deleted. Structure is documented below.
*/
rollout?: pulumi.Input<inputs.osconfig.OsPolicyAssignmentRollout>;
/**
* Output only. OS policy assignment rollout state
*/
rolloutState?: pulumi.Input<string>;
/**
* Set to true to skip awaiting rollout during resource creation and update.
*/
skipAwaitRollout?: pulumi.Input<boolean>;
/**
* Output only. Server generated unique id for the OS policy assignment
* resource.
*/
uid?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a OsPolicyAssignment resource.
*/
export interface OsPolicyAssignmentArgs {
/**
* OS policy assignment description. Length of the description is limited to 1024 characters.
*/
description?: pulumi.Input<string>;
/**
* Filter to select VMs. Structure is
* documented below.
*/
instanceFilter: pulumi.Input<inputs.osconfig.OsPolicyAssignmentInstanceFilter>;
/**
* The location for the resource
*/
location: pulumi.Input<string>;
/**
* Resource name.
*/
name?: pulumi.Input<string>;
/**
* List of OS policies to be applied to the VMs.
* Structure is documented below.
*/
osPolicies: pulumi.Input<pulumi.Input<inputs.osconfig.OsPolicyAssignmentOsPolicy>[]>;
/**
* The project for the resource
*/
project?: pulumi.Input<string>;
/**
* Rollout to deploy the OS policy assignment. A rollout
* is triggered in the following situations: 1) OSPolicyAssignment is created.
* 2) OSPolicyAssignment is updated and the update contains changes to one of
* the following fields: - instanceFilter - osPolicies 3) OSPolicyAssignment
* is deleted. Structure is documented below.
*/
rollout: pulumi.Input<inputs.osconfig.OsPolicyAssignmentRollout>;
/**
* Set to true to skip awaiting rollout during resource creation and update.
*/
skipAwaitRollout?: pulumi.Input<boolean>;
}