@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
150 lines (149 loc) • 5.46 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* An association for the OrganizationSecurityPolicy.
*
* To get more information about OrganizationSecurityPolicyAssociation, see:
*
* * [API documentation](https://cloud.google.com/compute/docs/reference/rest/beta/organizationSecurityPolicies/addAssociation)
* * How-to Guides
* * [Associating a policy with the organization or folder](https://cloud.google.com/vpc/docs/using-firewall-policies#associate)
*
* ## Example Usage
*
* ### Organization Security Policy Association Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const securityPolicyTarget = new gcp.organizations.Folder("security_policy_target", {
* displayName: "tf-test-secpol",
* parent: "organizations/123456789",
* deletionProtection: false,
* });
* const policy = new gcp.compute.OrganizationSecurityPolicy("policy", {
* displayName: "tf-test",
* parent: securityPolicyTarget.name,
* });
* const policyOrganizationSecurityPolicyRule = new gcp.compute.OrganizationSecurityPolicyRule("policy", {
* policyId: policy.id,
* action: "allow",
* direction: "INGRESS",
* enableLogging: true,
* match: {
* config: {
* srcIpRanges: [
* "192.168.0.0/16",
* "10.0.0.0/8",
* ],
* layer4Configs: [
* {
* ipProtocol: "tcp",
* ports: ["22"],
* },
* {
* ipProtocol: "icmp",
* },
* ],
* },
* },
* priority: 100,
* });
* const policyOrganizationSecurityPolicyAssociation = new gcp.compute.OrganizationSecurityPolicyAssociation("policy", {
* name: "tf-test",
* attachmentId: policy.parent,
* policyId: policy.id,
* });
* ```
*
* ## Import
*
* OrganizationSecurityPolicyAssociation can be imported using any of these accepted formats:
*
* * `{{policy_id}}/association/{{name}}`
*
* When using the `pulumi import` command, OrganizationSecurityPolicyAssociation can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:compute/organizationSecurityPolicyAssociation:OrganizationSecurityPolicyAssociation default {{policy_id}}/association/{{name}}
* ```
*/
export declare class OrganizationSecurityPolicyAssociation extends pulumi.CustomResource {
/**
* Get an existing OrganizationSecurityPolicyAssociation 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?: OrganizationSecurityPolicyAssociationState, opts?: pulumi.CustomResourceOptions): OrganizationSecurityPolicyAssociation;
/**
* Returns true if the given object is an instance of OrganizationSecurityPolicyAssociation. 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 OrganizationSecurityPolicyAssociation;
/**
* The resource that the security policy is attached to.
*/
readonly attachmentId: pulumi.Output<string>;
/**
* The display name of the security policy of the association.
*/
readonly displayName: pulumi.Output<string>;
/**
* The name for an association.
*/
readonly name: pulumi.Output<string>;
/**
* The security policy ID of the association.
*/
readonly policyId: pulumi.Output<string>;
/**
* Create a OrganizationSecurityPolicyAssociation 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: OrganizationSecurityPolicyAssociationArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering OrganizationSecurityPolicyAssociation resources.
*/
export interface OrganizationSecurityPolicyAssociationState {
/**
* The resource that the security policy is attached to.
*/
attachmentId?: pulumi.Input<string>;
/**
* The display name of the security policy of the association.
*/
displayName?: pulumi.Input<string>;
/**
* The name for an association.
*/
name?: pulumi.Input<string>;
/**
* The security policy ID of the association.
*/
policyId?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a OrganizationSecurityPolicyAssociation resource.
*/
export interface OrganizationSecurityPolicyAssociationArgs {
/**
* The resource that the security policy is attached to.
*/
attachmentId: pulumi.Input<string>;
/**
* The name for an association.
*/
name?: pulumi.Input<string>;
/**
* The security policy ID of the association.
*/
policyId: pulumi.Input<string>;
}