@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
511 lines • 22.7 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* VPC Flow Logs Config is a resource that lets you configure Flow Logs for Networks, Subnets, Interconnect attachments or VPN Tunnels.
*
* ## Example Usage
*
* ### Network Management Vpc Flow Logs Config Interconnect Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const project = gcp.organizations.getProject({});
* const network = new gcp.compute.Network("network", {name: "basic-interconnect-test-network"});
* const router = new gcp.compute.Router("router", {
* name: "basic-interconnect-test-router",
* network: network.name,
* bgp: {
* asn: 16550,
* },
* });
* const attachment = new gcp.compute.InterconnectAttachment("attachment", {
* name: "basic-interconnect-test-id",
* edgeAvailabilityDomain: "AVAILABILITY_DOMAIN_1",
* type: "PARTNER",
* router: router.id,
* mtu: "1500",
* });
* const interconnect_test = new gcp.networkmanagement.VpcFlowLogsConfig("interconnect-test", {
* vpcFlowLogsConfigId: "basic-interconnect-test-id",
* location: "global",
* interconnectAttachment: pulumi.all([project, attachment.name]).apply(([project, name]) => `projects/${project.number}/regions/us-east4/interconnectAttachments/${name}`),
* });
* ```
* ### Network Management Vpc Flow Logs Config Vpn Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const project = gcp.organizations.getProject({});
* const network = new gcp.compute.Network("network", {name: "basic-test-network"});
* const targetGateway = new gcp.compute.VPNGateway("target_gateway", {
* name: "basic-test-gateway",
* network: network.id,
* });
* const vpnStaticIp = new gcp.compute.Address("vpn_static_ip", {name: "basic-test-address"});
* const frEsp = new gcp.compute.ForwardingRule("fr_esp", {
* name: "basic-test-fresp",
* ipProtocol: "ESP",
* ipAddress: vpnStaticIp.address,
* target: targetGateway.id,
* });
* const frUdp500 = new gcp.compute.ForwardingRule("fr_udp500", {
* name: "basic-test-fr500",
* ipProtocol: "UDP",
* portRange: "500",
* ipAddress: vpnStaticIp.address,
* target: targetGateway.id,
* });
* const frUdp4500 = new gcp.compute.ForwardingRule("fr_udp4500", {
* name: "basic-test-fr4500",
* ipProtocol: "UDP",
* portRange: "4500",
* ipAddress: vpnStaticIp.address,
* target: targetGateway.id,
* });
* const tunnel = new gcp.compute.VPNTunnel("tunnel", {
* name: "basic-test-tunnel",
* peerIp: "15.0.0.120",
* sharedSecret: "a secret message",
* targetVpnGateway: targetGateway.id,
* }, {
* dependsOn: [
* frEsp,
* frUdp500,
* frUdp4500,
* ],
* });
* const vpn_test = new gcp.networkmanagement.VpcFlowLogsConfig("vpn-test", {
* vpcFlowLogsConfigId: "basic-test-id",
* location: "global",
* vpnTunnel: pulumi.all([project, tunnel.name]).apply(([project, name]) => `projects/${project.number}/regions/us-central1/vpnTunnels/${name}`),
* });
* const route = new gcp.compute.Route("route", {
* name: "basic-test-route",
* network: network.name,
* destRange: "15.0.0.0/24",
* priority: 1000,
* nextHopVpnTunnel: tunnel.id,
* });
* ```
* ### Network Management Vpc Flow Logs Config Network Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const project = gcp.organizations.getProject({});
* const network = new gcp.compute.Network("network", {name: "basic-network-test-network"});
* const network_test = new gcp.networkmanagement.VpcFlowLogsConfig("network-test", {
* vpcFlowLogsConfigId: "basic-network-test-id",
* location: "global",
* network: pulumi.all([project, network.name]).apply(([project, name]) => `projects/${project.number}/global/networks/${name}`),
* });
* ```
* ### Network Management Vpc Flow Logs Config Subnet Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const project = gcp.organizations.getProject({});
* const network = new gcp.compute.Network("network", {
* name: "basic-subnet-test-network",
* autoCreateSubnetworks: false,
* });
* const subnetwork = new gcp.compute.Subnetwork("subnetwork", {
* name: "basic-subnet-test-subnetwork",
* ipCidrRange: "10.2.0.0/16",
* region: "us-central1",
* network: network.id,
* });
* const subnet_test = new gcp.networkmanagement.VpcFlowLogsConfig("subnet-test", {
* vpcFlowLogsConfigId: "basic-subnet-test-id",
* location: "global",
* subnet: pulumi.all([project, subnetwork.name]).apply(([project, name]) => `projects/${project.number}/regions/us-central1/subnetworks/${name}`),
* });
* ```
*
* ## Import
*
* VpcFlowLogsConfig can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/vpcFlowLogsConfigs/{{vpc_flow_logs_config_id}}`
* * `{{project}}/{{location}}/{{vpc_flow_logs_config_id}}`
* * `{{location}}/{{vpc_flow_logs_config_id}}`
*
* When using the `pulumi import` command, VpcFlowLogsConfig can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:networkmanagement/vpcFlowLogsConfig:VpcFlowLogsConfig default projects/{{project}}/locations/{{location}}/vpcFlowLogsConfigs/{{vpc_flow_logs_config_id}}
* $ pulumi import gcp:networkmanagement/vpcFlowLogsConfig:VpcFlowLogsConfig default {{project}}/{{location}}/{{vpc_flow_logs_config_id}}
* $ pulumi import gcp:networkmanagement/vpcFlowLogsConfig:VpcFlowLogsConfig default {{location}}/{{vpc_flow_logs_config_id}}
* ```
*/
export declare class VpcFlowLogsConfig extends pulumi.CustomResource {
/**
* Get an existing VpcFlowLogsConfig 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?: VpcFlowLogsConfigState, opts?: pulumi.CustomResourceOptions): VpcFlowLogsConfig;
/**
* Returns true if the given object is an instance of VpcFlowLogsConfig. 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 VpcFlowLogsConfig;
/**
* Optional. The aggregation interval for the logs. Default value is
* INTERVAL_5_SEC. Possible values: AGGREGATION_INTERVAL_UNSPECIFIED INTERVAL_5_SEC INTERVAL_30_SEC INTERVAL_1_MIN INTERVAL_5_MIN INTERVAL_10_MIN INTERVAL_15_MIN
*/
readonly aggregationInterval: pulumi.Output<string>;
/**
* Output only. The time the config 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>;
/**
* Optional. The user-supplied description of the VPC Flow Logs configuration. Maximum
* of 512 characters.
*/
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;
}>;
/**
* Optional. Export filter used to define which VPC Flow Logs should be logged.
*/
readonly filterExpr: pulumi.Output<string | undefined>;
/**
* Optional. The value of the field must be in (0, 1]. The sampling rate
* of VPC Flow Logs where 1.0 means all collected logs are reported. Setting the
* sampling rate to 0.0 is not allowed. If you want to disable VPC Flow Logs, use
* the state field instead. Default value is 1.0.
*/
readonly flowSampling: pulumi.Output<number>;
/**
* Traffic will be logged from the Interconnect Attachment. Format: projects/{project_id}/regions/{region}/interconnectAttachments/{name}
*/
readonly interconnectAttachment: pulumi.Output<string | undefined>;
/**
* Optional. Resource labels to represent user-provided metadata.
*
* **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>;
/**
* Resource ID segment making up resource `name`. It identifies the resource
* within its parent collection as described in https://google.aip.dev/122. See documentation
* for resource type `networkmanagement.googleapis.com/VpcFlowLogsConfig`.
*/
readonly location: pulumi.Output<string>;
/**
* Optional. Configures whether all, none or a subset of metadata fields
* should be added to the reported VPC flow logs. Default value is INCLUDE_ALL_METADATA.
* Possible values: METADATA_UNSPECIFIED INCLUDE_ALL_METADATA EXCLUDE_ALL_METADATA CUSTOM_METADATA
*/
readonly metadata: pulumi.Output<string>;
/**
* Optional. Custom metadata fields to include in the reported VPC flow
* logs. Can only be specified if \"metadata\" was set to CUSTOM_METADATA.
*/
readonly metadataFields: pulumi.Output<string[] | undefined>;
/**
* Identifier. Unique name of the configuration using the form: `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
*/
readonly name: pulumi.Output<string>;
/**
* Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments within the network. Format: projects/{project_id}/global/networks/{name}
*/
readonly network: pulumi.Output<string | undefined>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
readonly project: 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;
}>;
/**
* Optional. The state of the VPC Flow Log configuration. Default value
* is ENABLED. When creating a new configuration, it must be enabled.
* Possible values: STATE_UNSPECIFIED ENABLED DISABLED
*/
readonly state: pulumi.Output<string>;
/**
* Traffic will be logged from VMs within the subnetwork. Format: projects/{project_id}/regions/{region}/subnetworks/{name}
*/
readonly subnet: pulumi.Output<string | undefined>;
/**
* Describes the state of the configured target resource for diagnostic
* purposes.
* Possible values:
* TARGET_RESOURCE_STATE_UNSPECIFIED
* TARGET_RESOURCE_EXISTS
* TARGET_RESOURCE_DOES_NOT_EXIST
*/
readonly targetResourceState: pulumi.Output<string>;
/**
* Output only. The time the config was updated.
*/
readonly updateTime: pulumi.Output<string>;
/**
* Required. ID of the `VpcFlowLogsConfig`.
*/
readonly vpcFlowLogsConfigId: pulumi.Output<string>;
/**
* Traffic will be logged from the VPN Tunnel. Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}
*/
readonly vpnTunnel: pulumi.Output<string | undefined>;
/**
* Create a VpcFlowLogsConfig 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: VpcFlowLogsConfigArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering VpcFlowLogsConfig resources.
*/
export interface VpcFlowLogsConfigState {
/**
* Optional. The aggregation interval for the logs. Default value is
* INTERVAL_5_SEC. Possible values: AGGREGATION_INTERVAL_UNSPECIFIED INTERVAL_5_SEC INTERVAL_30_SEC INTERVAL_1_MIN INTERVAL_5_MIN INTERVAL_10_MIN INTERVAL_15_MIN
*/
aggregationInterval?: pulumi.Input<string | undefined>;
/**
* Output only. The time the config 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>;
/**
* Optional. The user-supplied description of the VPC Flow Logs configuration. Maximum
* of 512 characters.
*/
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>;
/**
* Optional. Export filter used to define which VPC Flow Logs should be logged.
*/
filterExpr?: pulumi.Input<string | undefined>;
/**
* Optional. The value of the field must be in (0, 1]. The sampling rate
* of VPC Flow Logs where 1.0 means all collected logs are reported. Setting the
* sampling rate to 0.0 is not allowed. If you want to disable VPC Flow Logs, use
* the state field instead. Default value is 1.0.
*/
flowSampling?: pulumi.Input<number | undefined>;
/**
* Traffic will be logged from the Interconnect Attachment. Format: projects/{project_id}/regions/{region}/interconnectAttachments/{name}
*/
interconnectAttachment?: pulumi.Input<string | undefined>;
/**
* Optional. Resource labels to represent user-provided metadata.
*
* **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>;
/**
* Resource ID segment making up resource `name`. It identifies the resource
* within its parent collection as described in https://google.aip.dev/122. See documentation
* for resource type `networkmanagement.googleapis.com/VpcFlowLogsConfig`.
*/
location?: pulumi.Input<string | undefined>;
/**
* Optional. Configures whether all, none or a subset of metadata fields
* should be added to the reported VPC flow logs. Default value is INCLUDE_ALL_METADATA.
* Possible values: METADATA_UNSPECIFIED INCLUDE_ALL_METADATA EXCLUDE_ALL_METADATA CUSTOM_METADATA
*/
metadata?: pulumi.Input<string | undefined>;
/**
* Optional. Custom metadata fields to include in the reported VPC flow
* logs. Can only be specified if \"metadata\" was set to CUSTOM_METADATA.
*/
metadataFields?: pulumi.Input<pulumi.Input<string>[] | undefined>;
/**
* Identifier. Unique name of the configuration using the form: `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
*/
name?: pulumi.Input<string | undefined>;
/**
* Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments within the network. Format: projects/{project_id}/global/networks/{name}
*/
network?: pulumi.Input<string | undefined>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: 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>;
/**
* Optional. The state of the VPC Flow Log configuration. Default value
* is ENABLED. When creating a new configuration, it must be enabled.
* Possible values: STATE_UNSPECIFIED ENABLED DISABLED
*/
state?: pulumi.Input<string | undefined>;
/**
* Traffic will be logged from VMs within the subnetwork. Format: projects/{project_id}/regions/{region}/subnetworks/{name}
*/
subnet?: pulumi.Input<string | undefined>;
/**
* Describes the state of the configured target resource for diagnostic
* purposes.
* Possible values:
* TARGET_RESOURCE_STATE_UNSPECIFIED
* TARGET_RESOURCE_EXISTS
* TARGET_RESOURCE_DOES_NOT_EXIST
*/
targetResourceState?: pulumi.Input<string | undefined>;
/**
* Output only. The time the config was updated.
*/
updateTime?: pulumi.Input<string | undefined>;
/**
* Required. ID of the `VpcFlowLogsConfig`.
*/
vpcFlowLogsConfigId?: pulumi.Input<string | undefined>;
/**
* Traffic will be logged from the VPN Tunnel. Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}
*/
vpnTunnel?: pulumi.Input<string | undefined>;
}
/**
* The set of arguments for constructing a VpcFlowLogsConfig resource.
*/
export interface VpcFlowLogsConfigArgs {
/**
* Optional. The aggregation interval for the logs. Default value is
* INTERVAL_5_SEC. Possible values: AGGREGATION_INTERVAL_UNSPECIFIED INTERVAL_5_SEC INTERVAL_30_SEC INTERVAL_1_MIN INTERVAL_5_MIN INTERVAL_10_MIN INTERVAL_15_MIN
*/
aggregationInterval?: 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>;
/**
* Optional. The user-supplied description of the VPC Flow Logs configuration. Maximum
* of 512 characters.
*/
description?: pulumi.Input<string | undefined>;
/**
* Optional. Export filter used to define which VPC Flow Logs should be logged.
*/
filterExpr?: pulumi.Input<string | undefined>;
/**
* Optional. The value of the field must be in (0, 1]. The sampling rate
* of VPC Flow Logs where 1.0 means all collected logs are reported. Setting the
* sampling rate to 0.0 is not allowed. If you want to disable VPC Flow Logs, use
* the state field instead. Default value is 1.0.
*/
flowSampling?: pulumi.Input<number | undefined>;
/**
* Traffic will be logged from the Interconnect Attachment. Format: projects/{project_id}/regions/{region}/interconnectAttachments/{name}
*/
interconnectAttachment?: pulumi.Input<string | undefined>;
/**
* Optional. Resource labels to represent user-provided metadata.
*
* **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>;
/**
* Resource ID segment making up resource `name`. It identifies the resource
* within its parent collection as described in https://google.aip.dev/122. See documentation
* for resource type `networkmanagement.googleapis.com/VpcFlowLogsConfig`.
*/
location: pulumi.Input<string>;
/**
* Optional. Configures whether all, none or a subset of metadata fields
* should be added to the reported VPC flow logs. Default value is INCLUDE_ALL_METADATA.
* Possible values: METADATA_UNSPECIFIED INCLUDE_ALL_METADATA EXCLUDE_ALL_METADATA CUSTOM_METADATA
*/
metadata?: pulumi.Input<string | undefined>;
/**
* Optional. Custom metadata fields to include in the reported VPC flow
* logs. Can only be specified if \"metadata\" was set to CUSTOM_METADATA.
*/
metadataFields?: pulumi.Input<pulumi.Input<string>[] | undefined>;
/**
* Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments within the network. Format: projects/{project_id}/global/networks/{name}
*/
network?: pulumi.Input<string | undefined>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string | undefined>;
/**
* Optional. The state of the VPC Flow Log configuration. Default value
* is ENABLED. When creating a new configuration, it must be enabled.
* Possible values: STATE_UNSPECIFIED ENABLED DISABLED
*/
state?: pulumi.Input<string | undefined>;
/**
* Traffic will be logged from VMs within the subnetwork. Format: projects/{project_id}/regions/{region}/subnetworks/{name}
*/
subnet?: pulumi.Input<string | undefined>;
/**
* Required. ID of the `VpcFlowLogsConfig`.
*/
vpcFlowLogsConfigId: pulumi.Input<string>;
/**
* Traffic will be logged from the VPN Tunnel. Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}
*/
vpnTunnel?: pulumi.Input<string | undefined>;
}
//# sourceMappingURL=vpcFlowLogsConfig.d.ts.map