com.pulumi.gcp.compute.kotlin.ComputeFunctions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.compute.kotlin
import com.pulumi.gcp.compute.ComputeFunctions.getAddressPlain
import com.pulumi.gcp.compute.ComputeFunctions.getAddressesPlain
import com.pulumi.gcp.compute.ComputeFunctions.getBackendBucketIamPolicyPlain
import com.pulumi.gcp.compute.ComputeFunctions.getBackendBucketPlain
import com.pulumi.gcp.compute.ComputeFunctions.getBackendServiceIamPolicyPlain
import com.pulumi.gcp.compute.ComputeFunctions.getBackendServicePlain
import com.pulumi.gcp.compute.ComputeFunctions.getCertificatePlain
import com.pulumi.gcp.compute.ComputeFunctions.getDefaultServiceAccountPlain
import com.pulumi.gcp.compute.ComputeFunctions.getDiskIamPolicyPlain
import com.pulumi.gcp.compute.ComputeFunctions.getDiskPlain
import com.pulumi.gcp.compute.ComputeFunctions.getForwardingRulePlain
import com.pulumi.gcp.compute.ComputeFunctions.getForwardingRulesPlain
import com.pulumi.gcp.compute.ComputeFunctions.getGlobalAddressPlain
import com.pulumi.gcp.compute.ComputeFunctions.getGlobalForwardingRulePlain
import com.pulumi.gcp.compute.ComputeFunctions.getHcVpnGatewayPlain
import com.pulumi.gcp.compute.ComputeFunctions.getHealthCheckPlain
import com.pulumi.gcp.compute.ComputeFunctions.getImageIamPolicyPlain
import com.pulumi.gcp.compute.ComputeFunctions.getImagePlain
import com.pulumi.gcp.compute.ComputeFunctions.getInstanceGroupManagerPlain
import com.pulumi.gcp.compute.ComputeFunctions.getInstanceGroupPlain
import com.pulumi.gcp.compute.ComputeFunctions.getInstanceIamPolicyPlain
import com.pulumi.gcp.compute.ComputeFunctions.getInstancePlain
import com.pulumi.gcp.compute.ComputeFunctions.getInstanceSerialPortPlain
import com.pulumi.gcp.compute.ComputeFunctions.getInstanceTemplatePlain
import com.pulumi.gcp.compute.ComputeFunctions.getLBIPRangesPlain
import com.pulumi.gcp.compute.ComputeFunctions.getMachineImageIamPolicyPlain
import com.pulumi.gcp.compute.ComputeFunctions.getMachineTypesPlain
import com.pulumi.gcp.compute.ComputeFunctions.getNetblockIPRangesPlain
import com.pulumi.gcp.compute.ComputeFunctions.getNetworkEndpointGroupPlain
import com.pulumi.gcp.compute.ComputeFunctions.getNetworkPeeringPlain
import com.pulumi.gcp.compute.ComputeFunctions.getNetworkPlain
import com.pulumi.gcp.compute.ComputeFunctions.getNetworksPlain
import com.pulumi.gcp.compute.ComputeFunctions.getNodeTypesPlain
import com.pulumi.gcp.compute.ComputeFunctions.getRegionBackendServiceIamPolicyPlain
import com.pulumi.gcp.compute.ComputeFunctions.getRegionDiskIamPolicyPlain
import com.pulumi.gcp.compute.ComputeFunctions.getRegionDiskPlain
import com.pulumi.gcp.compute.ComputeFunctions.getRegionInstanceGroupPlain
import com.pulumi.gcp.compute.ComputeFunctions.getRegionInstanceTemplatePlain
import com.pulumi.gcp.compute.ComputeFunctions.getRegionNetworkEndpointGroupPlain
import com.pulumi.gcp.compute.ComputeFunctions.getRegionSslCertificatePlain
import com.pulumi.gcp.compute.ComputeFunctions.getRegionsPlain
import com.pulumi.gcp.compute.ComputeFunctions.getReservationPlain
import com.pulumi.gcp.compute.ComputeFunctions.getResourcePolicyPlain
import com.pulumi.gcp.compute.ComputeFunctions.getRouterNatPlain
import com.pulumi.gcp.compute.ComputeFunctions.getRouterPlain
import com.pulumi.gcp.compute.ComputeFunctions.getRouterStatusPlain
import com.pulumi.gcp.compute.ComputeFunctions.getSSLPolicyPlain
import com.pulumi.gcp.compute.ComputeFunctions.getSnapshotIamPolicyPlain
import com.pulumi.gcp.compute.ComputeFunctions.getSnapshotPlain
import com.pulumi.gcp.compute.ComputeFunctions.getSubnetworkIamPolicyPlain
import com.pulumi.gcp.compute.ComputeFunctions.getSubnetworkPlain
import com.pulumi.gcp.compute.ComputeFunctions.getVPNGatewayPlain
import com.pulumi.gcp.compute.ComputeFunctions.getZonesPlain
import com.pulumi.gcp.compute.ComputeFunctions.routerStatusPlain
import com.pulumi.gcp.compute.kotlin.inputs.GetAddressPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetAddressPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetAddressesPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetAddressesPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetBackendBucketIamPolicyPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetBackendBucketIamPolicyPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetBackendBucketPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetBackendBucketPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetBackendServiceIamPolicyPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetBackendServiceIamPolicyPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetBackendServicePlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetBackendServicePlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetCertificatePlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetCertificatePlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetDefaultServiceAccountPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetDefaultServiceAccountPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetDiskIamPolicyPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetDiskIamPolicyPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetDiskPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetDiskPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetForwardingRulePlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetForwardingRulePlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetForwardingRulesPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetForwardingRulesPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetGlobalAddressPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetGlobalAddressPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetGlobalForwardingRulePlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetGlobalForwardingRulePlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetHcVpnGatewayPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetHcVpnGatewayPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetHealthCheckPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetHealthCheckPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetImageIamPolicyPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetImageIamPolicyPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetImagePlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetImagePlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetInstanceGroupManagerPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetInstanceGroupManagerPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetInstanceGroupPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetInstanceGroupPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetInstanceIamPolicyPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetInstanceIamPolicyPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetInstancePlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetInstancePlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetInstanceSerialPortPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetInstanceSerialPortPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetInstanceTemplatePlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetInstanceTemplatePlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetMachineImageIamPolicyPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetMachineImageIamPolicyPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetMachineTypesPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetMachineTypesPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetNetblockIPRangesPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetNetblockIPRangesPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetNetworkEndpointGroupPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetNetworkEndpointGroupPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetNetworkPeeringPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetNetworkPeeringPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetNetworkPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetNetworkPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetNetworksPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetNetworksPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetNodeTypesPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetNodeTypesPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetRegionBackendServiceIamPolicyPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetRegionBackendServiceIamPolicyPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetRegionDiskIamPolicyPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetRegionDiskIamPolicyPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetRegionDiskPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetRegionDiskPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetRegionInstanceGroupPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetRegionInstanceGroupPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetRegionInstanceTemplatePlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetRegionInstanceTemplatePlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetRegionNetworkEndpointGroupPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetRegionNetworkEndpointGroupPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetRegionSslCertificatePlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetRegionSslCertificatePlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetRegionsPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetRegionsPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetReservationPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetReservationPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetResourcePolicyPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetResourcePolicyPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetRouterNatPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetRouterNatPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetRouterPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetRouterPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetRouterStatusPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetRouterStatusPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetSSLPolicyPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetSSLPolicyPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetSnapshotIamPolicyPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetSnapshotIamPolicyPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetSnapshotPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetSnapshotPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetSubnetworkIamPolicyPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetSubnetworkIamPolicyPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetSubnetworkPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetSubnetworkPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetVPNGatewayPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetVPNGatewayPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.GetZonesPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.GetZonesPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.RouterStatusPlainArgs
import com.pulumi.gcp.compute.kotlin.inputs.RouterStatusPlainArgsBuilder
import com.pulumi.gcp.compute.kotlin.outputs.GetAddressResult
import com.pulumi.gcp.compute.kotlin.outputs.GetAddressesResult
import com.pulumi.gcp.compute.kotlin.outputs.GetBackendBucketIamPolicyResult
import com.pulumi.gcp.compute.kotlin.outputs.GetBackendBucketResult
import com.pulumi.gcp.compute.kotlin.outputs.GetBackendServiceIamPolicyResult
import com.pulumi.gcp.compute.kotlin.outputs.GetBackendServiceResult
import com.pulumi.gcp.compute.kotlin.outputs.GetCertificateResult
import com.pulumi.gcp.compute.kotlin.outputs.GetDefaultServiceAccountResult
import com.pulumi.gcp.compute.kotlin.outputs.GetDiskIamPolicyResult
import com.pulumi.gcp.compute.kotlin.outputs.GetDiskResult
import com.pulumi.gcp.compute.kotlin.outputs.GetForwardingRuleResult
import com.pulumi.gcp.compute.kotlin.outputs.GetForwardingRulesResult
import com.pulumi.gcp.compute.kotlin.outputs.GetGlobalAddressResult
import com.pulumi.gcp.compute.kotlin.outputs.GetGlobalForwardingRuleResult
import com.pulumi.gcp.compute.kotlin.outputs.GetHcVpnGatewayResult
import com.pulumi.gcp.compute.kotlin.outputs.GetHealthCheckResult
import com.pulumi.gcp.compute.kotlin.outputs.GetImageIamPolicyResult
import com.pulumi.gcp.compute.kotlin.outputs.GetImageResult
import com.pulumi.gcp.compute.kotlin.outputs.GetInstanceGroupManagerResult
import com.pulumi.gcp.compute.kotlin.outputs.GetInstanceGroupResult
import com.pulumi.gcp.compute.kotlin.outputs.GetInstanceIamPolicyResult
import com.pulumi.gcp.compute.kotlin.outputs.GetInstanceResult
import com.pulumi.gcp.compute.kotlin.outputs.GetInstanceSerialPortResult
import com.pulumi.gcp.compute.kotlin.outputs.GetInstanceTemplateResult
import com.pulumi.gcp.compute.kotlin.outputs.GetLBIPRangesResult
import com.pulumi.gcp.compute.kotlin.outputs.GetMachineImageIamPolicyResult
import com.pulumi.gcp.compute.kotlin.outputs.GetMachineTypesResult
import com.pulumi.gcp.compute.kotlin.outputs.GetNetblockIPRangesResult
import com.pulumi.gcp.compute.kotlin.outputs.GetNetworkEndpointGroupResult
import com.pulumi.gcp.compute.kotlin.outputs.GetNetworkPeeringResult
import com.pulumi.gcp.compute.kotlin.outputs.GetNetworkResult
import com.pulumi.gcp.compute.kotlin.outputs.GetNetworksResult
import com.pulumi.gcp.compute.kotlin.outputs.GetNodeTypesResult
import com.pulumi.gcp.compute.kotlin.outputs.GetRegionBackendServiceIamPolicyResult
import com.pulumi.gcp.compute.kotlin.outputs.GetRegionDiskIamPolicyResult
import com.pulumi.gcp.compute.kotlin.outputs.GetRegionDiskResult
import com.pulumi.gcp.compute.kotlin.outputs.GetRegionInstanceGroupResult
import com.pulumi.gcp.compute.kotlin.outputs.GetRegionInstanceTemplateResult
import com.pulumi.gcp.compute.kotlin.outputs.GetRegionNetworkEndpointGroupResult
import com.pulumi.gcp.compute.kotlin.outputs.GetRegionSslCertificateResult
import com.pulumi.gcp.compute.kotlin.outputs.GetRegionsResult
import com.pulumi.gcp.compute.kotlin.outputs.GetReservationResult
import com.pulumi.gcp.compute.kotlin.outputs.GetResourcePolicyResult
import com.pulumi.gcp.compute.kotlin.outputs.GetRouterNatResult
import com.pulumi.gcp.compute.kotlin.outputs.GetRouterResult
import com.pulumi.gcp.compute.kotlin.outputs.GetRouterStatusResult
import com.pulumi.gcp.compute.kotlin.outputs.GetSSLPolicyResult
import com.pulumi.gcp.compute.kotlin.outputs.GetSnapshotIamPolicyResult
import com.pulumi.gcp.compute.kotlin.outputs.GetSnapshotResult
import com.pulumi.gcp.compute.kotlin.outputs.GetSubnetworkIamPolicyResult
import com.pulumi.gcp.compute.kotlin.outputs.GetSubnetworkResult
import com.pulumi.gcp.compute.kotlin.outputs.GetVPNGatewayResult
import com.pulumi.gcp.compute.kotlin.outputs.GetZonesResult
import com.pulumi.gcp.compute.kotlin.outputs.RouterStatusResult
import kotlinx.coroutines.future.await
import kotlin.Boolean
import kotlin.Deprecated
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import com.pulumi.gcp.compute.kotlin.outputs.GetAddressResult.Companion.toKotlin as getAddressResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetAddressesResult.Companion.toKotlin as getAddressesResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetBackendBucketIamPolicyResult.Companion.toKotlin as getBackendBucketIamPolicyResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetBackendBucketResult.Companion.toKotlin as getBackendBucketResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetBackendServiceIamPolicyResult.Companion.toKotlin as getBackendServiceIamPolicyResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetBackendServiceResult.Companion.toKotlin as getBackendServiceResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetCertificateResult.Companion.toKotlin as getCertificateResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetDefaultServiceAccountResult.Companion.toKotlin as getDefaultServiceAccountResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetDiskIamPolicyResult.Companion.toKotlin as getDiskIamPolicyResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetDiskResult.Companion.toKotlin as getDiskResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetForwardingRuleResult.Companion.toKotlin as getForwardingRuleResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetForwardingRulesResult.Companion.toKotlin as getForwardingRulesResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetGlobalAddressResult.Companion.toKotlin as getGlobalAddressResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetGlobalForwardingRuleResult.Companion.toKotlin as getGlobalForwardingRuleResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetHcVpnGatewayResult.Companion.toKotlin as getHcVpnGatewayResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetHealthCheckResult.Companion.toKotlin as getHealthCheckResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetImageIamPolicyResult.Companion.toKotlin as getImageIamPolicyResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetImageResult.Companion.toKotlin as getImageResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetInstanceGroupManagerResult.Companion.toKotlin as getInstanceGroupManagerResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetInstanceGroupResult.Companion.toKotlin as getInstanceGroupResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetInstanceIamPolicyResult.Companion.toKotlin as getInstanceIamPolicyResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetInstanceResult.Companion.toKotlin as getInstanceResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetInstanceSerialPortResult.Companion.toKotlin as getInstanceSerialPortResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetInstanceTemplateResult.Companion.toKotlin as getInstanceTemplateResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetLBIPRangesResult.Companion.toKotlin as getLBIPRangesResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetMachineImageIamPolicyResult.Companion.toKotlin as getMachineImageIamPolicyResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetMachineTypesResult.Companion.toKotlin as getMachineTypesResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetNetblockIPRangesResult.Companion.toKotlin as getNetblockIPRangesResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetNetworkEndpointGroupResult.Companion.toKotlin as getNetworkEndpointGroupResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetNetworkPeeringResult.Companion.toKotlin as getNetworkPeeringResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetNetworkResult.Companion.toKotlin as getNetworkResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetNetworksResult.Companion.toKotlin as getNetworksResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetNodeTypesResult.Companion.toKotlin as getNodeTypesResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetRegionBackendServiceIamPolicyResult.Companion.toKotlin as getRegionBackendServiceIamPolicyResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetRegionDiskIamPolicyResult.Companion.toKotlin as getRegionDiskIamPolicyResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetRegionDiskResult.Companion.toKotlin as getRegionDiskResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetRegionInstanceGroupResult.Companion.toKotlin as getRegionInstanceGroupResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetRegionInstanceTemplateResult.Companion.toKotlin as getRegionInstanceTemplateResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetRegionNetworkEndpointGroupResult.Companion.toKotlin as getRegionNetworkEndpointGroupResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetRegionSslCertificateResult.Companion.toKotlin as getRegionSslCertificateResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetRegionsResult.Companion.toKotlin as getRegionsResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetReservationResult.Companion.toKotlin as getReservationResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetResourcePolicyResult.Companion.toKotlin as getResourcePolicyResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetRouterNatResult.Companion.toKotlin as getRouterNatResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetRouterResult.Companion.toKotlin as getRouterResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetRouterStatusResult.Companion.toKotlin as getRouterStatusResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetSSLPolicyResult.Companion.toKotlin as getSSLPolicyResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetSnapshotIamPolicyResult.Companion.toKotlin as getSnapshotIamPolicyResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetSnapshotResult.Companion.toKotlin as getSnapshotResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetSubnetworkIamPolicyResult.Companion.toKotlin as getSubnetworkIamPolicyResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetSubnetworkResult.Companion.toKotlin as getSubnetworkResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetVPNGatewayResult.Companion.toKotlin as getVPNGatewayResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.GetZonesResult.Companion.toKotlin as getZonesResultToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.RouterStatusResult.Companion.toKotlin as routerStatusResultToKotlin
public object ComputeFunctions {
/**
* Get the IP address from a static address. For more information see
* the official [API](https://cloud.google.com/compute/docs/reference/latest/addresses/get) documentation.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const myAddress = gcp.compute.getAddress({
* name: "foobar",
* });
* const prod = new gcp.dns.ManagedZone("prod", {
* name: "prod-zone",
* dnsName: "prod.mydomain.com.",
* });
* const frontend = new gcp.dns.RecordSet("frontend", {
* name: pulumi.interpolate`frontend.${prod.dnsName}`,
* type: "A",
* ttl: 300,
* managedZone: prod.name,
* rrdatas: [myAddress.then(myAddress => myAddress.address)],
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* my_address = gcp.compute.get_address(name="foobar")
* prod = gcp.dns.ManagedZone("prod",
* name="prod-zone",
* dns_name="prod.mydomain.com.")
* frontend = gcp.dns.RecordSet("frontend",
* name=prod.dns_name.apply(lambda dns_name: f"frontend.{dns_name}"),
* type="A",
* ttl=300,
* managed_zone=prod.name,
* rrdatas=[my_address.address])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var myAddress = Gcp.Compute.GetAddress.Invoke(new()
* {
* Name = "foobar",
* });
* var prod = new Gcp.Dns.ManagedZone("prod", new()
* {
* Name = "prod-zone",
* DnsName = "prod.mydomain.com.",
* });
* var frontend = new Gcp.Dns.RecordSet("frontend", new()
* {
* Name = prod.DnsName.Apply(dnsName => $"frontend.{dnsName}"),
* Type = "A",
* Ttl = 300,
* ManagedZone = prod.Name,
* Rrdatas = new[]
* {
* myAddress.Apply(getAddressResult => getAddressResult.Address),
* },
* });
* });
* ```
* ```go
* package main
* import (
* "fmt"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/dns"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* myAddress, err := compute.LookupAddress(ctx, &compute.LookupAddressArgs{
* Name: "foobar",
* }, nil)
* if err != nil {
* return err
* }
* prod, err := dns.NewManagedZone(ctx, "prod", &dns.ManagedZoneArgs{
* Name: pulumi.String("prod-zone"),
* DnsName: pulumi.String("prod.mydomain.com."),
* })
* if err != nil {
* return err
* }
* _, err = dns.NewRecordSet(ctx, "frontend", &dns.RecordSetArgs{
* Name: prod.DnsName.ApplyT(func(dnsName string) (string, error) {
* return fmt.Sprintf("frontend.%v", dnsName), nil
* }).(pulumi.StringOutput),
* Type: pulumi.String("A"),
* Ttl: pulumi.Int(300),
* ManagedZone: prod.Name,
* Rrdatas: pulumi.StringArray{
* pulumi.String(myAddress.Address),
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetAddressArgs;
* import com.pulumi.gcp.dns.ManagedZone;
* import com.pulumi.gcp.dns.ManagedZoneArgs;
* import com.pulumi.gcp.dns.RecordSet;
* import com.pulumi.gcp.dns.RecordSetArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var myAddress = ComputeFunctions.getAddress(GetAddressArgs.builder()
* .name("foobar")
* .build());
* var prod = new ManagedZone("prod", ManagedZoneArgs.builder()
* .name("prod-zone")
* .dnsName("prod.mydomain.com.")
* .build());
* var frontend = new RecordSet("frontend", RecordSetArgs.builder()
* .name(prod.dnsName().applyValue(dnsName -> String.format("frontend.%s", dnsName)))
* .type("A")
* .ttl(300)
* .managedZone(prod.name())
* .rrdatas(myAddress.applyValue(getAddressResult -> getAddressResult.address()))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* frontend:
* type: gcp:dns:RecordSet
* properties:
* name: frontend.${prod.dnsName}
* type: A
* ttl: 300
* managedZone: ${prod.name}
* rrdatas:
* - ${myAddress.address}
* prod:
* type: gcp:dns:ManagedZone
* properties:
* name: prod-zone
* dnsName: prod.mydomain.com.
* variables:
* myAddress:
* fn::invoke:
* Function: gcp:compute:getAddress
* Arguments:
* name: foobar
* ```
*
* @param argument A collection of arguments for invoking getAddress.
* @return A collection of values returned by getAddress.
*/
public suspend fun getAddress(argument: GetAddressPlainArgs): GetAddressResult =
getAddressResultToKotlin(getAddressPlain(argument.toJava()).await())
/**
* @see [getAddress].
* @param name A unique name for the resource, required by GCE.
* - - -
* @param project The project in which the resource belongs. If it
* is not provided, the provider project is used.
* @param region The Region in which the created address reside.
* If it is not provided, the provider region is used.
* @return A collection of values returned by getAddress.
*/
public suspend fun getAddress(
name: String,
project: String? = null,
region: String? = null,
): GetAddressResult {
val argument = GetAddressPlainArgs(
name = name,
project = project,
region = region,
)
return getAddressResultToKotlin(getAddressPlain(argument.toJava()).await())
}
/**
* @see [getAddress].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetAddressPlainArgs].
* @return A collection of values returned by getAddress.
*/
public suspend fun getAddress(argument: suspend GetAddressPlainArgsBuilder.() -> Unit): GetAddressResult {
val builder = GetAddressPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getAddressResultToKotlin(getAddressPlain(builtArgument.toJava()).await())
}
/**
* List IP addresses in a project. For more information see
* the official API [list](https://cloud.google.com/compute/docs/reference/latest/addresses/list) and
* [aggregated list](https://cloud.google.com/compute/docs/reference/rest/v1/addresses/aggregatedList) documentation.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const test = gcp.compute.getAddresses({
* filter: "name:test-*",
* });
* const prod = new gcp.dns.ManagedZone("prod", {
* name: "prod-zone",
* dnsName: "prod.mydomain.com.",
* });
* const frontend = new gcp.dns.RecordSet("frontend", {
* name: pulumi.interpolate`frontend.${prod.dnsName}`,
* type: "A",
* ttl: 300,
* managedZone: prod.name,
* rrdatas: test.then(test => test.addresses.map(__item => __item.address)),
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* test = gcp.compute.get_addresses(filter="name:test-*")
* prod = gcp.dns.ManagedZone("prod",
* name="prod-zone",
* dns_name="prod.mydomain.com.")
* frontend = gcp.dns.RecordSet("frontend",
* name=prod.dns_name.apply(lambda dns_name: f"frontend.{dns_name}"),
* type="A",
* ttl=300,
* managed_zone=prod.name,
* rrdatas=[__item.address for __item in test.addresses])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var test = Gcp.Compute.GetAddresses.Invoke(new()
* {
* Filter = "name:test-*",
* });
* var prod = new Gcp.Dns.ManagedZone("prod", new()
* {
* Name = "prod-zone",
* DnsName = "prod.mydomain.com.",
* });
* var frontend = new Gcp.Dns.RecordSet("frontend", new()
* {
* Name = prod.DnsName.Apply(dnsName => $"frontend.{dnsName}"),
* Type = "A",
* Ttl = 300,
* ManagedZone = prod.Name,
* Rrdatas = test.Apply(getAddressesResult => getAddressesResult.Addresses).Select(__item => __item.Address).ToList(),
* });
* });
* ```
* ```go
* package main
* import (
* "fmt"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/dns"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* test, err := compute.GetAddresses(ctx, &compute.GetAddressesArgs{
* Filter: pulumi.StringRef("name:test-*"),
* }, nil)
* if err != nil {
* return err
* }
* prod, err := dns.NewManagedZone(ctx, "prod", &dns.ManagedZoneArgs{
* Name: pulumi.String("prod-zone"),
* DnsName: pulumi.String("prod.mydomain.com."),
* })
* if err != nil {
* return err
* }
* var splat0 []*string
* for _, val0 := range test.Addresses {
* splat0 = append(splat0, val0.Address)
* }
* _, err = dns.NewRecordSet(ctx, "frontend", &dns.RecordSetArgs{
* Name: prod.DnsName.ApplyT(func(dnsName string) (string, error) {
* return fmt.Sprintf("frontend.%v", dnsName), nil
* }).(pulumi.StringOutput),
* Type: pulumi.String("A"),
* Ttl: pulumi.Int(300),
* ManagedZone: prod.Name,
* Rrdatas: splat0,
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetAddressesArgs;
* import com.pulumi.gcp.dns.ManagedZone;
* import com.pulumi.gcp.dns.ManagedZoneArgs;
* import com.pulumi.gcp.dns.RecordSet;
* import com.pulumi.gcp.dns.RecordSetArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var test = ComputeFunctions.getAddresses(GetAddressesArgs.builder()
* .filter("name:test-*")
* .build());
* var prod = new ManagedZone("prod", ManagedZoneArgs.builder()
* .name("prod-zone")
* .dnsName("prod.mydomain.com.")
* .build());
* var frontend = new RecordSet("frontend", RecordSetArgs.builder()
* .name(prod.dnsName().applyValue(dnsName -> String.format("frontend.%s", dnsName)))
* .type("A")
* .ttl(300)
* .managedZone(prod.name())
* .rrdatas(test.applyValue(getAddressesResult -> getAddressesResult.addresses()).stream().map(element -> element.address()).collect(toList()))
* .build());
* }
* }
* ```
*
* @param argument A collection of arguments for invoking getAddresses.
* @return A collection of values returned by getAddresses.
*/
public suspend fun getAddresses(argument: GetAddressesPlainArgs): GetAddressesResult =
getAddressesResultToKotlin(getAddressesPlain(argument.toJava()).await())
/**
* @see [getAddresses].
* @param filter A filter expression that
* filters resources listed in the response. The expression must specify
* the field name, an operator, and the value that you want to use for
* filtering. The value must be a string, a number, or a boolean. The
* operator must be either "=", "!=", ">", "<", "<=", ">=" or ":". For
* example, if you are filtering Compute Engine instances, you can
* exclude instances named "example-instance" by specifying "name !=
* example-instance". The ":" operator can be used with string fields to
* match substrings. For non-string fields it is equivalent to the "="
* operator. The ":*" comparison can be used to test whether a key has
* been defined. For example, to find all objects with "owner" label
* use: """ labels.owner:* """ You can also filter nested fields. For
* example, you could specify "scheduling.automaticRestart = false" to
* include instances only if they are not scheduled for automatic
* restarts. You can use filtering on nested fields to filter based on
* resource labels. To filter on multiple expressions, provide each
* separate expression within parentheses. For example: """
* (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
* """ By default, each expression is an "AND" expression. However, you
* can include "AND" and "OR" expressions explicitly. For example: """
* (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
* AND (scheduling.automaticRestart = true)
* @param project The google project in which addresses are listed.
* Defaults to provider's configuration if missing.
* @param region Region that should be considered to search addresses.
* All regions are considered if missing.
* @return A collection of values returned by getAddresses.
*/
public suspend fun getAddresses(
filter: String? = null,
project: String? = null,
region: String? = null,
): GetAddressesResult {
val argument = GetAddressesPlainArgs(
filter = filter,
project = project,
region = region,
)
return getAddressesResultToKotlin(getAddressesPlain(argument.toJava()).await())
}
/**
* @see [getAddresses].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetAddressesPlainArgs].
* @return A collection of values returned by getAddresses.
*/
public suspend fun getAddresses(argument: suspend GetAddressesPlainArgsBuilder.() -> Unit): GetAddressesResult {
val builder = GetAddressesPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getAddressesResultToKotlin(getAddressesPlain(builtArgument.toJava()).await())
}
/**
* Get information about a BackendBucket.
* ## Example Usage
* ```tf
* data "google_compute_backend_bucket" "my-backend-bucket" {
* name = "my-backend"
* }
* ```
* @param argument A collection of arguments for invoking getBackendBucket.
* @return A collection of values returned by getBackendBucket.
*/
public suspend fun getBackendBucket(argument: GetBackendBucketPlainArgs): GetBackendBucketResult =
getBackendBucketResultToKotlin(getBackendBucketPlain(argument.toJava()).await())
/**
* @see [getBackendBucket].
* @param name Name of the resource.
* - - -
* @param project The ID of the project in which the resource belongs. If it
* is not provided, the provider project is used.
* @return A collection of values returned by getBackendBucket.
*/
public suspend fun getBackendBucket(name: String, project: String? = null): GetBackendBucketResult {
val argument = GetBackendBucketPlainArgs(
name = name,
project = project,
)
return getBackendBucketResultToKotlin(getBackendBucketPlain(argument.toJava()).await())
}
/**
* @see [getBackendBucket].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetBackendBucketPlainArgs].
* @return A collection of values returned by getBackendBucket.
*/
public suspend fun getBackendBucket(argument: suspend GetBackendBucketPlainArgsBuilder.() -> Unit): GetBackendBucketResult {
val builder = GetBackendBucketPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getBackendBucketResultToKotlin(getBackendBucketPlain(builtArgument.toJava()).await())
}
/**
*
* @param argument A collection of arguments for invoking getBackendBucketIamPolicy.
* @return A collection of values returned by getBackendBucketIamPolicy.
*/
public suspend fun getBackendBucketIamPolicy(argument: GetBackendBucketIamPolicyPlainArgs): GetBackendBucketIamPolicyResult =
getBackendBucketIamPolicyResultToKotlin(getBackendBucketIamPolicyPlain(argument.toJava()).await())
/**
* @see [getBackendBucketIamPolicy].
* @param name Used to find the parent resource to bind the IAM policy to
* @param project The ID of the project in which the resource belongs.
* If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
* @return A collection of values returned by getBackendBucketIamPolicy.
*/
public suspend fun getBackendBucketIamPolicy(name: String, project: String? = null): GetBackendBucketIamPolicyResult {
val argument = GetBackendBucketIamPolicyPlainArgs(
name = name,
project = project,
)
return getBackendBucketIamPolicyResultToKotlin(getBackendBucketIamPolicyPlain(argument.toJava()).await())
}
/**
* @see [getBackendBucketIamPolicy].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetBackendBucketIamPolicyPlainArgs].
* @return A collection of values returned by getBackendBucketIamPolicy.
*/
public suspend fun getBackendBucketIamPolicy(argument: suspend GetBackendBucketIamPolicyPlainArgsBuilder.() -> Unit): GetBackendBucketIamPolicyResult {
val builder = GetBackendBucketIamPolicyPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getBackendBucketIamPolicyResultToKotlin(getBackendBucketIamPolicyPlain(builtArgument.toJava()).await())
}
/**
* Provide access to a Backend Service's attribute. For more information
* see [the official documentation](https://cloud.google.com/compute/docs/load-balancing/http/backend-service)
* and the [API](https://cloud.google.com/compute/docs/reference/latest/backendServices).
* ## Example Usage
* ```tf
* data "google_compute_backend_service" "baz" {
* name = "foobar"
* }
* resource "google_compute_backend_service" "default" {
* name = "backend-service"
* health_checks = [tolist(data.google_compute_backend_service.baz.health_checks)[0]]
* }
* ```
* @param argument A collection of arguments for invoking getBackendService.
* @return A collection of values returned by getBackendService.
*/
public suspend fun getBackendService(argument: GetBackendServicePlainArgs): GetBackendServiceResult =
getBackendServiceResultToKotlin(getBackendServicePlain(argument.toJava()).await())
/**
* @see [getBackendService].
* @param name The name of the Backend Service.
* - - -
* @param project The project in which the resource belongs. If it is not provided, the provider project is used.
* @return A collection of values returned by getBackendService.
*/
public suspend fun getBackendService(name: String, project: String? = null): GetBackendServiceResult {
val argument = GetBackendServicePlainArgs(
name = name,
project = project,
)
return getBackendServiceResultToKotlin(getBackendServicePlain(argument.toJava()).await())
}
/**
* @see [getBackendService].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetBackendServicePlainArgs].
* @return A collection of values returned by getBackendService.
*/
public suspend fun getBackendService(argument: suspend GetBackendServicePlainArgsBuilder.() -> Unit): GetBackendServiceResult {
val builder = GetBackendServicePlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getBackendServiceResultToKotlin(getBackendServicePlain(builtArgument.toJava()).await())
}
/**
*
* @param argument A collection of arguments for invoking getBackendServiceIamPolicy.
* @return A collection of values returned by getBackendServiceIamPolicy.
*/
public suspend fun getBackendServiceIamPolicy(argument: GetBackendServiceIamPolicyPlainArgs): GetBackendServiceIamPolicyResult =
getBackendServiceIamPolicyResultToKotlin(getBackendServiceIamPolicyPlain(argument.toJava()).await())
/**
* @see [getBackendServiceIamPolicy].
* @param name Used to find the parent resource to bind the IAM policy to
* @param project The ID of the project in which the resource belongs.
* If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
* @return A collection of values returned by getBackendServiceIamPolicy.
*/
public suspend fun getBackendServiceIamPolicy(name: String, project: String? = null): GetBackendServiceIamPolicyResult {
val argument = GetBackendServiceIamPolicyPlainArgs(
name = name,
project = project,
)
return getBackendServiceIamPolicyResultToKotlin(getBackendServiceIamPolicyPlain(argument.toJava()).await())
}
/**
* @see [getBackendServiceIamPolicy].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetBackendServiceIamPolicyPlainArgs].
* @return A collection of values returned by getBackendServiceIamPolicy.
*/
public suspend fun getBackendServiceIamPolicy(argument: suspend GetBackendServiceIamPolicyPlainArgsBuilder.() -> Unit): GetBackendServiceIamPolicyResult {
val builder = GetBackendServiceIamPolicyPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getBackendServiceIamPolicyResultToKotlin(getBackendServiceIamPolicyPlain(builtArgument.toJava()).await())
}
/**
* Get info about a Google Compute SSL Certificate from its name.
* ## Example Usage
* ```tf
* data "google_compute_ssl_certificate" "my_cert" {
* name = "my-cert"
* }
* output "certificate" {
* value = data.google_compute_ssl_certificate.my_cert.certificate
* }
* output "certificate_id" {
* value = data.google_compute_ssl_certificate.my_cert.certificate_id
* }
* output "self_link" {
* value = data.google_compute_ssl_certificate.my_cert.self_link
* }
* ```
* @param argument A collection of arguments for invoking getCertificate.
* @return A collection of values returned by getCertificate.
*/
public suspend fun getCertificate(argument: GetCertificatePlainArgs): GetCertificateResult =
getCertificateResultToKotlin(getCertificatePlain(argument.toJava()).await())
/**
* @see [getCertificate].
* @param name The name of the certificate.
* - - -
* @param project The project in which the resource belongs. If it
* is not provided, the provider project is used.
* @return A collection of values returned by getCertificate.
*/
public suspend fun getCertificate(name: String, project: String? = null): GetCertificateResult {
val argument = GetCertificatePlainArgs(
name = name,
project = project,
)
return getCertificateResultToKotlin(getCertificatePlain(argument.toJava()).await())
}
/**
* @see [getCertificate].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetCertificatePlainArgs].
* @return A collection of values returned by getCertificate.
*/
public suspend fun getCertificate(argument: suspend GetCertificatePlainArgsBuilder.() -> Unit): GetCertificateResult {
val builder = GetCertificatePlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getCertificateResultToKotlin(getCertificatePlain(builtArgument.toJava()).await())
}
/**
* Use this data source to retrieve default service account for this project
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const default = gcp.compute.getDefaultServiceAccount({});
* export const defaultAccount = _default.then(_default => _default.email);
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default = gcp.compute.get_default_service_account()
* pulumi.export("defaultAccount", default.email)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var @default = Gcp.Compute.GetDefaultServiceAccount.Invoke();
* return new Dictionary
* {
* ["defaultAccount"] = @default.Apply(@default => @default.Apply(getDefaultServiceAccountResult => getDefaultServiceAccountResult.Email)),
* };
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _default, err := compute.GetDefaultServiceAccount(ctx, nil, nil)
* if err != nil {
* return err
* }
* ctx.Export("defaultAccount", _default.Email)
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetDefaultServiceAccountArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var default = ComputeFunctions.getDefaultServiceAccount();
* ctx.export("defaultAccount", default_.email());
* }
* }
* ```
* ```yaml
* variables:
* default:
* fn::invoke:
* Function: gcp:compute:getDefaultServiceAccount
* Arguments: {}
* outputs:
* defaultAccount: ${default.email}
* ```
*
* @param argument A collection of arguments for invoking getDefaultServiceAccount.
* @return A collection of values returned by getDefaultServiceAccount.
*/
public suspend fun getDefaultServiceAccount(argument: GetDefaultServiceAccountPlainArgs): GetDefaultServiceAccountResult =
getDefaultServiceAccountResultToKotlin(getDefaultServiceAccountPlain(argument.toJava()).await())
/**
* @see [getDefaultServiceAccount].
* @param project The project ID. If it is not provided, the provider project is used.
* @return A collection of values returned by getDefaultServiceAccount.
*/
public suspend fun getDefaultServiceAccount(project: String? = null): GetDefaultServiceAccountResult {
val argument = GetDefaultServiceAccountPlainArgs(
project = project,
)
return getDefaultServiceAccountResultToKotlin(getDefaultServiceAccountPlain(argument.toJava()).await())
}
/**
* @see [getDefaultServiceAccount].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetDefaultServiceAccountPlainArgs].
* @return A collection of values returned by getDefaultServiceAccount.
*/
public suspend fun getDefaultServiceAccount(argument: suspend GetDefaultServiceAccountPlainArgsBuilder.() -> Unit): GetDefaultServiceAccountResult {
val builder = GetDefaultServiceAccountPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getDefaultServiceAccountResultToKotlin(getDefaultServiceAccountPlain(builtArgument.toJava()).await())
}
/**
* Get information about a Google Compute Persistent disks.
* [the official documentation](https://cloud.google.com/compute/docs/disks) and its [API](https://cloud.google.com/compute/docs/reference/latest/disks).
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const persistent-boot-disk = gcp.compute.getDisk({
* name: "persistent-boot-disk",
* project: "example",
* });
* const _default = new gcp.compute.Instance("default", {bootDisk: {
* source: persistent_boot_disk.then(persistent_boot_disk => persistent_boot_disk.selfLink),
* autoDelete: false,
* }});
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* persistent_boot_disk = gcp.compute.get_disk(name="persistent-boot-disk",
* project="example")
* default = gcp.compute.Instance("default", boot_disk=gcp.compute.InstanceBootDiskArgs(
* source=persistent_boot_disk.self_link,
* auto_delete=False,
* ))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var persistent_boot_disk = Gcp.Compute.GetDisk.Invoke(new()
* {
* Name = "persistent-boot-disk",
* Project = "example",
* });
* var @default = new Gcp.Compute.Instance("default", new()
* {
* BootDisk = new Gcp.Compute.Inputs.InstanceBootDiskArgs
* {
* Source = persistent_boot_disk.Apply(persistent_boot_disk => persistent_boot_disk.Apply(getDiskResult => getDiskResult.SelfLink)),
* AutoDelete = false,
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* persistent_boot_disk, err := compute.LookupDisk(ctx, &compute.LookupDiskArgs{
* Name: "persistent-boot-disk",
* Project: pulumi.StringRef("example"),
* }, nil)
* if err != nil {
* return err
* }
* _, err = compute.NewInstance(ctx, "default", &compute.InstanceArgs{
* BootDisk: &compute.InstanceBootDiskArgs{
* Source: pulumi.String(persistent_boot_disk.SelfLink),
* AutoDelete: pulumi.Bool(false),
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetDiskArgs;
* import com.pulumi.gcp.compute.Instance;
* import com.pulumi.gcp.compute.InstanceArgs;
* import com.pulumi.gcp.compute.inputs.InstanceBootDiskArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var persistent-boot-disk = ComputeFunctions.getDisk(GetDiskArgs.builder()
* .name("persistent-boot-disk")
* .project("example")
* .build());
* var default_ = new Instance("default", InstanceArgs.builder()
* .bootDisk(InstanceBootDiskArgs.builder()
* .source(persistent_boot_disk.selfLink())
* .autoDelete(false)
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:compute:Instance
* properties:
* bootDisk:
* source: ${["persistent-boot-disk"].selfLink}
* autoDelete: false
* variables:
* persistent-boot-disk:
* fn::invoke:
* Function: gcp:compute:getDisk
* Arguments:
* name: persistent-boot-disk
* project: example
* ```
*
* @param argument A collection of arguments for invoking getDisk.
* @return A collection of values returned by getDisk.
*/
public suspend fun getDisk(argument: GetDiskPlainArgs): GetDiskResult =
getDiskResultToKotlin(getDiskPlain(argument.toJava()).await())
/**
* @see [getDisk].
* @param name The name of a specific disk.
* - - -
* @param project The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
* @param zone A reference to the zone where the disk resides.
* @return A collection of values returned by getDisk.
*/
public suspend fun getDisk(
name: String,
project: String? = null,
zone: String? = null,
): GetDiskResult {
val argument = GetDiskPlainArgs(
name = name,
project = project,
zone = zone,
)
return getDiskResultToKotlin(getDiskPlain(argument.toJava()).await())
}
/**
* @see [getDisk].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetDiskPlainArgs].
* @return A collection of values returned by getDisk.
*/
public suspend fun getDisk(argument: suspend GetDiskPlainArgsBuilder.() -> Unit): GetDiskResult {
val builder = GetDiskPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getDiskResultToKotlin(getDiskPlain(builtArgument.toJava()).await())
}
/**
* Retrieves the current IAM policy data for disk
* ## example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const policy = gcp.compute.getDiskIamPolicy({
* project: _default.project,
* zone: _default.zone,
* name: _default.name,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* policy = gcp.compute.get_disk_iam_policy(project=default["project"],
* zone=default["zone"],
* name=default["name"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var policy = Gcp.Compute.GetDiskIamPolicy.Invoke(new()
* {
* Project = @default.Project,
* Zone = @default.Zone,
* Name = @default.Name,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.LookupDiskIamPolicy(ctx, &compute.LookupDiskIamPolicyArgs{
* Project: pulumi.StringRef(_default.Project),
* Zone: pulumi.StringRef(_default.Zone),
* Name: _default.Name,
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetDiskIamPolicyArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var policy = ComputeFunctions.getDiskIamPolicy(GetDiskIamPolicyArgs.builder()
* .project(default_.project())
* .zone(default_.zone())
* .name(default_.name())
* .build());
* }
* }
* ```
* ```yaml
* variables:
* policy:
* fn::invoke:
* Function: gcp:compute:getDiskIamPolicy
* Arguments:
* project: ${default.project}
* zone: ${default.zone}
* name: ${default.name}
* ```
*
* @param argument A collection of arguments for invoking getDiskIamPolicy.
* @return A collection of values returned by getDiskIamPolicy.
*/
public suspend fun getDiskIamPolicy(argument: GetDiskIamPolicyPlainArgs): GetDiskIamPolicyResult =
getDiskIamPolicyResultToKotlin(getDiskIamPolicyPlain(argument.toJava()).await())
/**
* @see [getDiskIamPolicy].
* @param name Used to find the parent resource to bind the IAM policy to
* @param project The ID of the project in which the resource belongs.
* If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
* @param zone A reference to the zone where the disk resides. Used to find the parent resource to bind the IAM policy to. If not specified,
* the value will be parsed from the identifier of the parent resource. If no zone is provided in the parent identifier and no
* zone is specified, it is taken from the provider configuration.
* @return A collection of values returned by getDiskIamPolicy.
*/
public suspend fun getDiskIamPolicy(
name: String,
project: String? = null,
zone: String? = null,
): GetDiskIamPolicyResult {
val argument = GetDiskIamPolicyPlainArgs(
name = name,
project = project,
zone = zone,
)
return getDiskIamPolicyResultToKotlin(getDiskIamPolicyPlain(argument.toJava()).await())
}
/**
* @see [getDiskIamPolicy].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetDiskIamPolicyPlainArgs].
* @return A collection of values returned by getDiskIamPolicy.
*/
public suspend fun getDiskIamPolicy(argument: suspend GetDiskIamPolicyPlainArgsBuilder.() -> Unit): GetDiskIamPolicyResult {
val builder = GetDiskIamPolicyPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getDiskIamPolicyResultToKotlin(getDiskIamPolicyPlain(builtArgument.toJava()).await())
}
/**
* Get a forwarding rule within GCE from its name.
* ## Example Usage
* ```tf
* data "google_compute_forwarding_rule" "my-forwarding-rule" {
* name = "forwarding-rule-us-east1"
* }
* ```
* @param argument A collection of arguments for invoking getForwardingRule.
* @return A collection of values returned by getForwardingRule.
*/
public suspend fun getForwardingRule(argument: GetForwardingRulePlainArgs): GetForwardingRuleResult =
getForwardingRuleResultToKotlin(getForwardingRulePlain(argument.toJava()).await())
/**
* @see [getForwardingRule].
* @param name The name of the forwarding rule.
* - - -
* @param project The project in which the resource belongs. If it
* is not provided, the provider project is used.
* @param region The region in which the resource belongs. If it
* is not provided, the project region is used.
* @return A collection of values returned by getForwardingRule.
*/
public suspend fun getForwardingRule(
name: String,
project: String? = null,
region: String? = null,
): GetForwardingRuleResult {
val argument = GetForwardingRulePlainArgs(
name = name,
project = project,
region = region,
)
return getForwardingRuleResultToKotlin(getForwardingRulePlain(argument.toJava()).await())
}
/**
* @see [getForwardingRule].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetForwardingRulePlainArgs].
* @return A collection of values returned by getForwardingRule.
*/
public suspend fun getForwardingRule(argument: suspend GetForwardingRulePlainArgsBuilder.() -> Unit): GetForwardingRuleResult {
val builder = GetForwardingRulePlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getForwardingRuleResultToKotlin(getForwardingRulePlain(builtArgument.toJava()).await())
}
/**
* List all networks in a specified Google Cloud project.
* ## Example Usage
* ```tf
* data "google_compute_forwarding_rules" "my-forwarding-rules" {
* project = "my-cloud-project"
* region = "us-central1"
* }
* ```
* @param argument A collection of arguments for invoking getForwardingRules.
* @return A collection of values returned by getForwardingRules.
*/
public suspend fun getForwardingRules(argument: GetForwardingRulesPlainArgs): GetForwardingRulesResult =
getForwardingRulesResultToKotlin(getForwardingRulesPlain(argument.toJava()).await())
/**
* @see [getForwardingRules].
* @param project The name of the project.
* @param region The region you want to get the forwarding rules from.
* These arguments must be set in either the provider or the resouce in order for the information to be queried.
* @return A collection of values returned by getForwardingRules.
*/
public suspend fun getForwardingRules(project: String? = null, region: String? = null): GetForwardingRulesResult {
val argument = GetForwardingRulesPlainArgs(
project = project,
region = region,
)
return getForwardingRulesResultToKotlin(getForwardingRulesPlain(argument.toJava()).await())
}
/**
* @see [getForwardingRules].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetForwardingRulesPlainArgs].
* @return A collection of values returned by getForwardingRules.
*/
public suspend fun getForwardingRules(argument: suspend GetForwardingRulesPlainArgsBuilder.() -> Unit): GetForwardingRulesResult {
val builder = GetForwardingRulesPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getForwardingRulesResultToKotlin(getForwardingRulesPlain(builtArgument.toJava()).await())
}
/**
* Get the IP address from a static address reserved for a Global Forwarding Rule which are only used for HTTP load balancing. For more information see
* the official [API](https://cloud.google.com/compute/docs/reference/latest/globalAddresses) documentation.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const myAddress = gcp.compute.getGlobalAddress({
* name: "foobar",
* });
* const prod = new gcp.dns.ManagedZone("prod", {
* name: "prod-zone",
* dnsName: "prod.mydomain.com.",
* });
* const frontend = new gcp.dns.RecordSet("frontend", {
* name: pulumi.interpolate`lb.${prod.dnsName}`,
* type: "A",
* ttl: 300,
* managedZone: prod.name,
* rrdatas: [myAddress.then(myAddress => myAddress.address)],
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* my_address = gcp.compute.get_global_address(name="foobar")
* prod = gcp.dns.ManagedZone("prod",
* name="prod-zone",
* dns_name="prod.mydomain.com.")
* frontend = gcp.dns.RecordSet("frontend",
* name=prod.dns_name.apply(lambda dns_name: f"lb.{dns_name}"),
* type="A",
* ttl=300,
* managed_zone=prod.name,
* rrdatas=[my_address.address])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var myAddress = Gcp.Compute.GetGlobalAddress.Invoke(new()
* {
* Name = "foobar",
* });
* var prod = new Gcp.Dns.ManagedZone("prod", new()
* {
* Name = "prod-zone",
* DnsName = "prod.mydomain.com.",
* });
* var frontend = new Gcp.Dns.RecordSet("frontend", new()
* {
* Name = prod.DnsName.Apply(dnsName => $"lb.{dnsName}"),
* Type = "A",
* Ttl = 300,
* ManagedZone = prod.Name,
* Rrdatas = new[]
* {
* myAddress.Apply(getGlobalAddressResult => getGlobalAddressResult.Address),
* },
* });
* });
* ```
* ```go
* package main
* import (
* "fmt"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/dns"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* myAddress, err := compute.LookupGlobalAddress(ctx, &compute.LookupGlobalAddressArgs{
* Name: "foobar",
* }, nil)
* if err != nil {
* return err
* }
* prod, err := dns.NewManagedZone(ctx, "prod", &dns.ManagedZoneArgs{
* Name: pulumi.String("prod-zone"),
* DnsName: pulumi.String("prod.mydomain.com."),
* })
* if err != nil {
* return err
* }
* _, err = dns.NewRecordSet(ctx, "frontend", &dns.RecordSetArgs{
* Name: prod.DnsName.ApplyT(func(dnsName string) (string, error) {
* return fmt.Sprintf("lb.%v", dnsName), nil
* }).(pulumi.StringOutput),
* Type: pulumi.String("A"),
* Ttl: pulumi.Int(300),
* ManagedZone: prod.Name,
* Rrdatas: pulumi.StringArray{
* pulumi.String(myAddress.Address),
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetGlobalAddressArgs;
* import com.pulumi.gcp.dns.ManagedZone;
* import com.pulumi.gcp.dns.ManagedZoneArgs;
* import com.pulumi.gcp.dns.RecordSet;
* import com.pulumi.gcp.dns.RecordSetArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var myAddress = ComputeFunctions.getGlobalAddress(GetGlobalAddressArgs.builder()
* .name("foobar")
* .build());
* var prod = new ManagedZone("prod", ManagedZoneArgs.builder()
* .name("prod-zone")
* .dnsName("prod.mydomain.com.")
* .build());
* var frontend = new RecordSet("frontend", RecordSetArgs.builder()
* .name(prod.dnsName().applyValue(dnsName -> String.format("lb.%s", dnsName)))
* .type("A")
* .ttl(300)
* .managedZone(prod.name())
* .rrdatas(myAddress.applyValue(getGlobalAddressResult -> getGlobalAddressResult.address()))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* frontend:
* type: gcp:dns:RecordSet
* properties:
* name: lb.${prod.dnsName}
* type: A
* ttl: 300
* managedZone: ${prod.name}
* rrdatas:
* - ${myAddress.address}
* prod:
* type: gcp:dns:ManagedZone
* properties:
* name: prod-zone
* dnsName: prod.mydomain.com.
* variables:
* myAddress:
* fn::invoke:
* Function: gcp:compute:getGlobalAddress
* Arguments:
* name: foobar
* ```
*
* @param argument A collection of arguments for invoking getGlobalAddress.
* @return A collection of values returned by getGlobalAddress.
*/
public suspend fun getGlobalAddress(argument: GetGlobalAddressPlainArgs): GetGlobalAddressResult =
getGlobalAddressResultToKotlin(getGlobalAddressPlain(argument.toJava()).await())
/**
* @see [getGlobalAddress].
* @param name A unique name for the resource, required by GCE.
* - - -
* @param project The project in which the resource belongs. If it
* is not provided, the provider project is used.
* @return A collection of values returned by getGlobalAddress.
*/
public suspend fun getGlobalAddress(name: String, project: String? = null): GetGlobalAddressResult {
val argument = GetGlobalAddressPlainArgs(
name = name,
project = project,
)
return getGlobalAddressResultToKotlin(getGlobalAddressPlain(argument.toJava()).await())
}
/**
* @see [getGlobalAddress].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetGlobalAddressPlainArgs].
* @return A collection of values returned by getGlobalAddress.
*/
public suspend fun getGlobalAddress(argument: suspend GetGlobalAddressPlainArgsBuilder.() -> Unit): GetGlobalAddressResult {
val builder = GetGlobalAddressPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getGlobalAddressResultToKotlin(getGlobalAddressPlain(builtArgument.toJava()).await())
}
/**
* Get a global forwarding rule within GCE from its name.
* ## Example Usage
* ```tf
* data "google_compute_global_forwarding_rule" "my-forwarding-rule" {
* name = "forwarding-rule-global"
* }
* ```
* @param argument A collection of arguments for invoking getGlobalForwardingRule.
* @return A collection of values returned by getGlobalForwardingRule.
*/
public suspend fun getGlobalForwardingRule(argument: GetGlobalForwardingRulePlainArgs): GetGlobalForwardingRuleResult =
getGlobalForwardingRuleResultToKotlin(getGlobalForwardingRulePlain(argument.toJava()).await())
/**
* @see [getGlobalForwardingRule].
* @param name The name of the global forwarding rule.
* - - -
* @param project The project in which the resource belongs. If it
* is not provided, the provider project is used.
* @return A collection of values returned by getGlobalForwardingRule.
*/
public suspend fun getGlobalForwardingRule(name: String, project: String? = null): GetGlobalForwardingRuleResult {
val argument = GetGlobalForwardingRulePlainArgs(
name = name,
project = project,
)
return getGlobalForwardingRuleResultToKotlin(getGlobalForwardingRulePlain(argument.toJava()).await())
}
/**
* @see [getGlobalForwardingRule].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetGlobalForwardingRulePlainArgs].
* @return A collection of values returned by getGlobalForwardingRule.
*/
public suspend fun getGlobalForwardingRule(argument: suspend GetGlobalForwardingRulePlainArgsBuilder.() -> Unit): GetGlobalForwardingRuleResult {
val builder = GetGlobalForwardingRulePlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getGlobalForwardingRuleResultToKotlin(getGlobalForwardingRulePlain(builtArgument.toJava()).await())
}
/**
* Get a HA VPN Gateway within GCE from its name.
* ## Example Usage
* ```tf
* data "google_compute_ha_vpn_gateway" "gateway" {
* name = "foobar"
* }
* ```
* @param argument A collection of arguments for invoking getHcVpnGateway.
* @return A collection of values returned by getHcVpnGateway.
*/
public suspend fun getHcVpnGateway(argument: GetHcVpnGatewayPlainArgs): GetHcVpnGatewayResult =
getHcVpnGatewayResultToKotlin(getHcVpnGatewayPlain(argument.toJava()).await())
/**
* @see [getHcVpnGateway].
* @param name The name of the forwarding rule.
* - - -
* @param project The project in which the resource belongs. If it
* is not provided, the provider project is used.
* @param region The region in which the resource belongs. If it
* is not provided, the project region is used.
* @return A collection of values returned by getHcVpnGateway.
*/
public suspend fun getHcVpnGateway(
name: String,
project: String? = null,
region: String? = null,
): GetHcVpnGatewayResult {
val argument = GetHcVpnGatewayPlainArgs(
name = name,
project = project,
region = region,
)
return getHcVpnGatewayResultToKotlin(getHcVpnGatewayPlain(argument.toJava()).await())
}
/**
* @see [getHcVpnGateway].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetHcVpnGatewayPlainArgs].
* @return A collection of values returned by getHcVpnGateway.
*/
public suspend fun getHcVpnGateway(argument: suspend GetHcVpnGatewayPlainArgsBuilder.() -> Unit): GetHcVpnGatewayResult {
val builder = GetHcVpnGatewayPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getHcVpnGatewayResultToKotlin(getHcVpnGatewayPlain(builtArgument.toJava()).await())
}
/**
* Get information about a HealthCheck.
* ## Example Usage
* ```tf
* data "google_compute_health_check" "health_check" {
* name = "my-hc"
* }
* ```
* @param argument A collection of arguments for invoking getHealthCheck.
* @return A collection of values returned by getHealthCheck.
*/
public suspend fun getHealthCheck(argument: GetHealthCheckPlainArgs): GetHealthCheckResult =
getHealthCheckResultToKotlin(getHealthCheckPlain(argument.toJava()).await())
/**
* @see [getHealthCheck].
* @param name Name of the resource.
* - - -
* @param project The ID of the project in which the resource belongs. If it
* is not provided, the provider project is used.
* @return A collection of values returned by getHealthCheck.
*/
public suspend fun getHealthCheck(name: String, project: String? = null): GetHealthCheckResult {
val argument = GetHealthCheckPlainArgs(
name = name,
project = project,
)
return getHealthCheckResultToKotlin(getHealthCheckPlain(argument.toJava()).await())
}
/**
* @see [getHealthCheck].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetHealthCheckPlainArgs].
* @return A collection of values returned by getHealthCheck.
*/
public suspend fun getHealthCheck(argument: suspend GetHealthCheckPlainArgsBuilder.() -> Unit): GetHealthCheckResult {
val builder = GetHealthCheckPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getHealthCheckResultToKotlin(getHealthCheckPlain(builtArgument.toJava()).await())
}
/**
* Get information about a Google Compute Image. Check that your service account has the `compute.imageUser` role if you want to share [custom images](https://cloud.google.com/compute/docs/images/sharing-images-across-projects) from another project. If you want to use [public images][pubimg], do not forget to specify the dedicated project. For more information see
* [the official documentation](https://cloud.google.com/compute/docs/images) and its [API](https://cloud.google.com/compute/docs/reference/latest/images).
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const myImage = gcp.compute.getImage({
* family: "debian-11",
* project: "debian-cloud",
* });
* const _default = new gcp.compute.Instance("default", {bootDisk: {
* initializeParams: {
* image: myImage.then(myImage => myImage.selfLink),
* },
* }});
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* my_image = gcp.compute.get_image(family="debian-11",
* project="debian-cloud")
* default = gcp.compute.Instance("default", boot_disk=gcp.compute.InstanceBootDiskArgs(
* initialize_params=gcp.compute.InstanceBootDiskInitializeParamsArgs(
* image=my_image.self_link,
* ),
* ))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var myImage = Gcp.Compute.GetImage.Invoke(new()
* {
* Family = "debian-11",
* Project = "debian-cloud",
* });
* var @default = new Gcp.Compute.Instance("default", new()
* {
* BootDisk = new Gcp.Compute.Inputs.InstanceBootDiskArgs
* {
* InitializeParams = new Gcp.Compute.Inputs.InstanceBootDiskInitializeParamsArgs
* {
* Image = myImage.Apply(getImageResult => getImageResult.SelfLink),
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* myImage, err := compute.LookupImage(ctx, &compute.LookupImageArgs{
* Family: pulumi.StringRef("debian-11"),
* Project: pulumi.StringRef("debian-cloud"),
* }, nil)
* if err != nil {
* return err
* }
* _, err = compute.NewInstance(ctx, "default", &compute.InstanceArgs{
* BootDisk: &compute.InstanceBootDiskArgs{
* InitializeParams: &compute.InstanceBootDiskInitializeParamsArgs{
* Image: pulumi.String(myImage.SelfLink),
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetImageArgs;
* import com.pulumi.gcp.compute.Instance;
* import com.pulumi.gcp.compute.InstanceArgs;
* import com.pulumi.gcp.compute.inputs.InstanceBootDiskArgs;
* import com.pulumi.gcp.compute.inputs.InstanceBootDiskInitializeParamsArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var myImage = ComputeFunctions.getImage(GetImageArgs.builder()
* .family("debian-11")
* .project("debian-cloud")
* .build());
* var default_ = new Instance("default", InstanceArgs.builder()
* .bootDisk(InstanceBootDiskArgs.builder()
* .initializeParams(InstanceBootDiskInitializeParamsArgs.builder()
* .image(myImage.applyValue(getImageResult -> getImageResult.selfLink()))
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:compute:Instance
* properties:
* bootDisk:
* initializeParams:
* image: ${myImage.selfLink}
* variables:
* myImage:
* fn::invoke:
* Function: gcp:compute:getImage
* Arguments:
* family: debian-11
* project: debian-cloud
* ```
*
* @param argument A collection of arguments for invoking getImage.
* @return A collection of values returned by getImage.
*/
public suspend fun getImage(argument: GetImagePlainArgs): GetImageResult =
getImageResultToKotlin(getImagePlain(argument.toJava()).await())
/**
* @see [getImage].
* @param family The family name of the image.
* @param filter
* @param mostRecent A boolean to indicate either to take to most recent image if your filter
* returns more than one image.
* @param name , `family` or `filter` - (Required) The name of a specific image or a family.
* Exactly one of `name`, `family` or `filter` must be specified. If `name` is specified, it will fetch
* the corresponding image. If `family` is specified, it will return the latest image
* that is part of an image family and is not deprecated. If you specify `filter`, your
* filter must return exactly one image unless you use `most_recent`.
* Filter syntax can be found [here](https://cloud.google.com/compute/docs/reference/rest/v1/images/list) in the filter section.
* - - -
* @param project The project in which the resource belongs. If it is not
* provided, the provider project is used. If you are using a
* [public base image][pubimg], be sure to specify the correct Image Project.
* @return A collection of values returned by getImage.
*/
public suspend fun getImage(
family: String? = null,
filter: String? = null,
mostRecent: Boolean? = null,
name: String? = null,
project: String? = null,
): GetImageResult {
val argument = GetImagePlainArgs(
family = family,
filter = filter,
mostRecent = mostRecent,
name = name,
project = project,
)
return getImageResultToKotlin(getImagePlain(argument.toJava()).await())
}
/**
* @see [getImage].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetImagePlainArgs].
* @return A collection of values returned by getImage.
*/
public suspend fun getImage(argument: suspend GetImagePlainArgsBuilder.() -> Unit): GetImageResult {
val builder = GetImagePlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getImageResultToKotlin(getImagePlain(builtArgument.toJava()).await())
}
/**
* Retrieves the current IAM policy data for image
* ## example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const policy = gcp.compute.getImageIamPolicy({
* project: example.project,
* image: example.name,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* policy = gcp.compute.get_image_iam_policy(project=example["project"],
* image=example["name"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var policy = Gcp.Compute.GetImageIamPolicy.Invoke(new()
* {
* Project = example.Project,
* Image = example.Name,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.LookupImageIamPolicy(ctx, &compute.LookupImageIamPolicyArgs{
* Project: pulumi.StringRef(example.Project),
* Image: example.Name,
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetImageIamPolicyArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var policy = ComputeFunctions.getImageIamPolicy(GetImageIamPolicyArgs.builder()
* .project(example.project())
* .image(example.name())
* .build());
* }
* }
* ```
* ```yaml
* variables:
* policy:
* fn::invoke:
* Function: gcp:compute:getImageIamPolicy
* Arguments:
* project: ${example.project}
* image: ${example.name}
* ```
*
* @param argument A collection of arguments for invoking getImageIamPolicy.
* @return A collection of values returned by getImageIamPolicy.
*/
public suspend fun getImageIamPolicy(argument: GetImageIamPolicyPlainArgs): GetImageIamPolicyResult =
getImageIamPolicyResultToKotlin(getImageIamPolicyPlain(argument.toJava()).await())
/**
* @see [getImageIamPolicy].
* @param image Used to find the parent resource to bind the IAM policy to
* @param project The ID of the project in which the resource belongs.
* If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
* @return A collection of values returned by getImageIamPolicy.
*/
public suspend fun getImageIamPolicy(image: String, project: String? = null): GetImageIamPolicyResult {
val argument = GetImageIamPolicyPlainArgs(
image = image,
project = project,
)
return getImageIamPolicyResultToKotlin(getImageIamPolicyPlain(argument.toJava()).await())
}
/**
* @see [getImageIamPolicy].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetImageIamPolicyPlainArgs].
* @return A collection of values returned by getImageIamPolicy.
*/
public suspend fun getImageIamPolicy(argument: suspend GetImageIamPolicyPlainArgsBuilder.() -> Unit): GetImageIamPolicyResult {
val builder = GetImageIamPolicyPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getImageIamPolicyResultToKotlin(getImageIamPolicyPlain(builtArgument.toJava()).await())
}
/**
* Get information about a VM instance resource within GCE. For more information see
* [the official documentation](https://cloud.google.com/compute/docs/instances)
* and
* [API](https://cloud.google.com/compute/docs/reference/latest/instances).
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const appserver = gcp.compute.getInstance({
* name: "primary-application-server",
* zone: "us-central1-a",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* appserver = gcp.compute.get_instance(name="primary-application-server",
* zone="us-central1-a")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var appserver = Gcp.Compute.GetInstance.Invoke(new()
* {
* Name = "primary-application-server",
* Zone = "us-central1-a",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.LookupInstance(ctx, &compute.LookupInstanceArgs{
* Name: pulumi.StringRef("primary-application-server"),
* Zone: pulumi.StringRef("us-central1-a"),
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetInstanceArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var appserver = ComputeFunctions.getInstance(GetInstanceArgs.builder()
* .name("primary-application-server")
* .zone("us-central1-a")
* .build());
* }
* }
* ```
* ```yaml
* variables:
* appserver:
* fn::invoke:
* Function: gcp:compute:getInstance
* Arguments:
* name: primary-application-server
* zone: us-central1-a
* ```
*
* @param argument A collection of arguments for invoking getInstance.
* @return A collection of values returned by getInstance.
*/
public suspend fun getInstance(argument: GetInstancePlainArgs): GetInstanceResult =
getInstanceResultToKotlin(getInstancePlain(argument.toJava()).await())
/**
* @see [getInstance].
* @param name The name of the instance. One of `name` or `self_link` must be provided.
* @param project The ID of the project in which the resource belongs.
* If `self_link` is provided, this value is ignored. If neither `self_link`
* nor `project` are provided, the provider project is used.
* @param selfLink The self link of the instance. One of `name` or `self_link` must be provided.
* @param zone The zone of the instance. If `self_link` is provided, this
* value is ignored. If neither `self_link` nor `zone` are provided, the
* provider zone is used.
* @return A collection of values returned by getInstance.
*/
public suspend fun getInstance(
name: String? = null,
project: String? = null,
selfLink: String? = null,
zone: String? = null,
): GetInstanceResult {
val argument = GetInstancePlainArgs(
name = name,
project = project,
selfLink = selfLink,
zone = zone,
)
return getInstanceResultToKotlin(getInstancePlain(argument.toJava()).await())
}
/**
* @see [getInstance].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetInstancePlainArgs].
* @return A collection of values returned by getInstance.
*/
public suspend fun getInstance(argument: suspend GetInstancePlainArgsBuilder.() -> Unit): GetInstanceResult {
val builder = GetInstancePlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getInstanceResultToKotlin(getInstancePlain(builtArgument.toJava()).await())
}
/**
* Get a Compute Instance Group within GCE.
* For more information, see [the official documentation](https://cloud.google.com/compute/docs/instance-groups/#unmanaged_instance_groups)
* and [API](https://cloud.google.com/compute/docs/reference/latest/instanceGroups)
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const all = gcp.compute.getInstanceGroup({
* name: "instance-group-name",
* zone: "us-central1-a",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* all = gcp.compute.get_instance_group(name="instance-group-name",
* zone="us-central1-a")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var all = Gcp.Compute.GetInstanceGroup.Invoke(new()
* {
* Name = "instance-group-name",
* Zone = "us-central1-a",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.LookupInstanceGroup(ctx, &compute.LookupInstanceGroupArgs{
* Name: pulumi.StringRef("instance-group-name"),
* Zone: pulumi.StringRef("us-central1-a"),
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetInstanceGroupArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var all = ComputeFunctions.getInstanceGroup(GetInstanceGroupArgs.builder()
* .name("instance-group-name")
* .zone("us-central1-a")
* .build());
* }
* }
* ```
* ```yaml
* variables:
* all:
* fn::invoke:
* Function: gcp:compute:getInstanceGroup
* Arguments:
* name: instance-group-name
* zone: us-central1-a
* ```
*
* @param argument A collection of arguments for invoking getInstanceGroup.
* @return A collection of values returned by getInstanceGroup.
*/
public suspend fun getInstanceGroup(argument: GetInstanceGroupPlainArgs): GetInstanceGroupResult =
getInstanceGroupResultToKotlin(getInstanceGroupPlain(argument.toJava()).await())
/**
* @see [getInstanceGroup].
* @param name The name of the instance group. Either `name` or `self_link` must be provided.
* @param project The ID of the project in which the resource belongs. If it
* is not provided, the provider project is used.
* @param selfLink The self link of the instance group. Either `name` or `self_link` must be provided.
* @param zone The zone of the instance group. If referencing the instance group by name
* and `zone` is not provided, the provider zone is used.
* @return A collection of values returned by getInstanceGroup.
*/
public suspend fun getInstanceGroup(
name: String? = null,
project: String? = null,
selfLink: String? = null,
zone: String? = null,
): GetInstanceGroupResult {
val argument = GetInstanceGroupPlainArgs(
name = name,
project = project,
selfLink = selfLink,
zone = zone,
)
return getInstanceGroupResultToKotlin(getInstanceGroupPlain(argument.toJava()).await())
}
/**
* @see [getInstanceGroup].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetInstanceGroupPlainArgs].
* @return A collection of values returned by getInstanceGroup.
*/
public suspend fun getInstanceGroup(argument: suspend GetInstanceGroupPlainArgsBuilder.() -> Unit): GetInstanceGroupResult {
val builder = GetInstanceGroupPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getInstanceGroupResultToKotlin(getInstanceGroupPlain(builtArgument.toJava()).await())
}
/**
* Get a Compute Instance Group Manager within GCE.
* For more information, see [the official documentation](https://cloud.google.com/compute/docs/instance-groups#managed_instance_groups)
* and [API](https://cloud.google.com/compute/docs/reference/latest/instanceGroupManagers)
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const igm1 = gcp.compute.getInstanceGroupManager({
* name: "my-igm",
* zone: "us-central1-a",
* });
* const igm2 = gcp.compute.getInstanceGroupManager({
* selfLink: "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instanceGroupManagers/my-igm",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* igm1 = gcp.compute.get_instance_group_manager(name="my-igm",
* zone="us-central1-a")
* igm2 = gcp.compute.get_instance_group_manager(self_link="https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instanceGroupManagers/my-igm")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var igm1 = Gcp.Compute.GetInstanceGroupManager.Invoke(new()
* {
* Name = "my-igm",
* Zone = "us-central1-a",
* });
* var igm2 = Gcp.Compute.GetInstanceGroupManager.Invoke(new()
* {
* SelfLink = "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instanceGroupManagers/my-igm",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.LookupInstanceGroupManager(ctx, &compute.LookupInstanceGroupManagerArgs{
* Name: pulumi.StringRef("my-igm"),
* Zone: pulumi.StringRef("us-central1-a"),
* }, nil)
* if err != nil {
* return err
* }
* _, err = compute.LookupInstanceGroupManager(ctx, &compute.LookupInstanceGroupManagerArgs{
* SelfLink: pulumi.StringRef("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instanceGroupManagers/my-igm"),
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetInstanceGroupManagerArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var igm1 = ComputeFunctions.getInstanceGroupManager(GetInstanceGroupManagerArgs.builder()
* .name("my-igm")
* .zone("us-central1-a")
* .build());
* final var igm2 = ComputeFunctions.getInstanceGroupManager(GetInstanceGroupManagerArgs.builder()
* .selfLink("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instanceGroupManagers/my-igm")
* .build());
* }
* }
* ```
* ```yaml
* variables:
* igm1:
* fn::invoke:
* Function: gcp:compute:getInstanceGroupManager
* Arguments:
* name: my-igm
* zone: us-central1-a
* igm2:
* fn::invoke:
* Function: gcp:compute:getInstanceGroupManager
* Arguments:
* selfLink: https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instanceGroupManagers/my-igm
* ```
*
* @param argument A collection of arguments for invoking getInstanceGroupManager.
* @return A collection of values returned by getInstanceGroupManager.
*/
public suspend fun getInstanceGroupManager(argument: GetInstanceGroupManagerPlainArgs): GetInstanceGroupManagerResult =
getInstanceGroupManagerResultToKotlin(getInstanceGroupManagerPlain(argument.toJava()).await())
/**
* @see [getInstanceGroupManager].
* @param name The name of the instance group. Either `name` or `self_link` must be provided.
* @param project The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
* @param selfLink The self link of the instance group. Either `name` or `self_link` must be provided.
* @param zone The zone of the instance group. If referencing the instance group by name and `zone` is not provided, the provider zone is used.
* @return A collection of values returned by getInstanceGroupManager.
*/
public suspend fun getInstanceGroupManager(
name: String? = null,
project: String? = null,
selfLink: String? = null,
zone: String? = null,
): GetInstanceGroupManagerResult {
val argument = GetInstanceGroupManagerPlainArgs(
name = name,
project = project,
selfLink = selfLink,
zone = zone,
)
return getInstanceGroupManagerResultToKotlin(getInstanceGroupManagerPlain(argument.toJava()).await())
}
/**
* @see [getInstanceGroupManager].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetInstanceGroupManagerPlainArgs].
* @return A collection of values returned by getInstanceGroupManager.
*/
public suspend fun getInstanceGroupManager(argument: suspend GetInstanceGroupManagerPlainArgsBuilder.() -> Unit): GetInstanceGroupManagerResult {
val builder = GetInstanceGroupManagerPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getInstanceGroupManagerResultToKotlin(getInstanceGroupManagerPlain(builtArgument.toJava()).await())
}
/**
* Retrieves the current IAM policy data for instance
* ## example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const policy = gcp.compute.getInstanceIamPolicy({
* project: _default.project,
* zone: _default.zone,
* instanceName: _default.name,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* policy = gcp.compute.get_instance_iam_policy(project=default["project"],
* zone=default["zone"],
* instance_name=default["name"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var policy = Gcp.Compute.GetInstanceIamPolicy.Invoke(new()
* {
* Project = @default.Project,
* Zone = @default.Zone,
* InstanceName = @default.Name,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.GetInstanceIamPolicy(ctx, &compute.GetInstanceIamPolicyArgs{
* Project: pulumi.StringRef(_default.Project),
* Zone: pulumi.StringRef(_default.Zone),
* InstanceName: _default.Name,
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetInstanceIamPolicyArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var policy = ComputeFunctions.getInstanceIamPolicy(GetInstanceIamPolicyArgs.builder()
* .project(default_.project())
* .zone(default_.zone())
* .instanceName(default_.name())
* .build());
* }
* }
* ```
* ```yaml
* variables:
* policy:
* fn::invoke:
* Function: gcp:compute:getInstanceIamPolicy
* Arguments:
* project: ${default.project}
* zone: ${default.zone}
* instanceName: ${default.name}
* ```
*
* @param argument A collection of arguments for invoking getInstanceIamPolicy.
* @return A collection of values returned by getInstanceIamPolicy.
*/
public suspend fun getInstanceIamPolicy(argument: GetInstanceIamPolicyPlainArgs): GetInstanceIamPolicyResult =
getInstanceIamPolicyResultToKotlin(getInstanceIamPolicyPlain(argument.toJava()).await())
/**
* @see [getInstanceIamPolicy].
* @param instanceName Used to find the parent resource to bind the IAM policy to
* @param project The ID of the project in which the resource belongs.
* If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
* @param zone A reference to the zone where the machine resides. Used to find the parent resource to bind the IAM policy to. If not specified,
* the value will be parsed from the identifier of the parent resource. If no zone is provided in the parent identifier and no
* zone is specified, it is taken from the provider configuration.
* @return A collection of values returned by getInstanceIamPolicy.
*/
public suspend fun getInstanceIamPolicy(
instanceName: String,
project: String? = null,
zone: String? = null,
): GetInstanceIamPolicyResult {
val argument = GetInstanceIamPolicyPlainArgs(
instanceName = instanceName,
project = project,
zone = zone,
)
return getInstanceIamPolicyResultToKotlin(getInstanceIamPolicyPlain(argument.toJava()).await())
}
/**
* @see [getInstanceIamPolicy].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetInstanceIamPolicyPlainArgs].
* @return A collection of values returned by getInstanceIamPolicy.
*/
public suspend fun getInstanceIamPolicy(argument: suspend GetInstanceIamPolicyPlainArgsBuilder.() -> Unit): GetInstanceIamPolicyResult {
val builder = GetInstanceIamPolicyPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getInstanceIamPolicyResultToKotlin(getInstanceIamPolicyPlain(builtArgument.toJava()).await())
}
/**
* Get the serial port output from a Compute Instance. For more information see
* the official [API](https://cloud.google.com/compute/docs/instances/viewing-serial-port-output) documentation.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const serial = gcp.compute.getInstanceSerialPort({
* instance: "my-instance",
* zone: "us-central1-a",
* port: 1,
* });
* export const serialOut = serial.then(serial => serial.contents);
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* serial = gcp.compute.get_instance_serial_port(instance="my-instance",
* zone="us-central1-a",
* port=1)
* pulumi.export("serialOut", serial.contents)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var serial = Gcp.Compute.GetInstanceSerialPort.Invoke(new()
* {
* Instance = "my-instance",
* Zone = "us-central1-a",
* Port = 1,
* });
* return new Dictionary
* {
* ["serialOut"] = serial.Apply(getInstanceSerialPortResult => getInstanceSerialPortResult.Contents),
* };
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* serial, err := compute.GetInstanceSerialPort(ctx, &compute.GetInstanceSerialPortArgs{
* Instance: "my-instance",
* Zone: pulumi.StringRef("us-central1-a"),
* Port: 1,
* }, nil)
* if err != nil {
* return err
* }
* ctx.Export("serialOut", serial.Contents)
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetInstanceSerialPortArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var serial = ComputeFunctions.getInstanceSerialPort(GetInstanceSerialPortArgs.builder()
* .instance("my-instance")
* .zone("us-central1-a")
* .port(1)
* .build());
* ctx.export("serialOut", serial.applyValue(getInstanceSerialPortResult -> getInstanceSerialPortResult.contents()));
* }
* }
* ```
* ```yaml
* variables:
* serial:
* fn::invoke:
* Function: gcp:compute:getInstanceSerialPort
* Arguments:
* instance: my-instance
* zone: us-central1-a
* port: 1
* outputs:
* serialOut: ${serial.contents}
* ```
*
* Using the serial port output to generate a windows password, derived from the [official guide](https://cloud.google.com/compute/docs/instances/windows/automate-pw-generation):
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const windows = new gcp.compute.Instance("windows", {
* networkInterfaces: [{
* accessConfigs: [{}],
* network: "default",
* }],
* name: "windows-instance",
* machineType: "e2-medium",
* zone: "us-central1-a",
* bootDisk: {
* initializeParams: {
* image: "windows-cloud/windows-2019",
* },
* },
* metadata: {
* "serial-port-logging-enable": "TRUE",
* "windows-keys": JSON.stringify({
* email: "[email protected]",
* expireOn: "2020-04-14T01:37:19Z",
* exponent: "AQAB",
* modulus: "wgsquN4IBNPqIUnu+h/5Za1kujb2YRhX1vCQVQAkBwnWigcCqOBVfRa5JoZfx6KIvEXjWqa77jPvlsxM4WPqnDIM2qiK36up3SKkYwFjff6F2ni/ry8vrwXCX3sGZ1hbIHlK0O012HpA3ISeEswVZmX2X67naOvJXfY5v0hGPWqCADao+xVxrmxsZD4IWnKl1UaZzI5lhAzr8fw6utHwx1EZ/MSgsEki6tujcZfN+GUDRnmJGQSnPTXmsf7Q4DKreTZk49cuyB3prV91S0x3DYjCUpSXrkVy1Ha5XicGD/q+ystuFsJnrrhbNXJbpSjM6sjo/aduAkZJl4FmOt0R7Q==",
* userName: "example-user",
* }),
* },
* serviceAccount: {
* scopes: [
* "userinfo-email",
* "compute-ro",
* "storage-ro",
* ],
* },
* });
* const serial = pulumi.all([windows.name, windows.zone]).apply(([name, zone]) => gcp.compute.getInstanceSerialPortOutput({
* instance: name,
* zone: zone,
* port: 4,
* }));
* export const serialOut = serial.apply(serial => serial.contents);
* ```
* ```python
* import pulumi
* import json
* import pulumi_gcp as gcp
* windows = gcp.compute.Instance("windows",
* network_interfaces=[gcp.compute.InstanceNetworkInterfaceArgs(
* access_configs=[gcp.compute.InstanceNetworkInterfaceAccessConfigArgs()],
* network="default",
* )],
* name="windows-instance",
* machine_type="e2-medium",
* zone="us-central1-a",
* boot_disk=gcp.compute.InstanceBootDiskArgs(
* initialize_params=gcp.compute.InstanceBootDiskInitializeParamsArgs(
* image="windows-cloud/windows-2019",
* ),
* ),
* metadata={
* "serial-port-logging-enable": "TRUE",
* "windows-keys": json.dumps({
* "email": "[email protected]",
* "expireOn": "2020-04-14T01:37:19Z",
* "exponent": "AQAB",
* "modulus": "wgsquN4IBNPqIUnu+h/5Za1kujb2YRhX1vCQVQAkBwnWigcCqOBVfRa5JoZfx6KIvEXjWqa77jPvlsxM4WPqnDIM2qiK36up3SKkYwFjff6F2ni/ry8vrwXCX3sGZ1hbIHlK0O012HpA3ISeEswVZmX2X67naOvJXfY5v0hGPWqCADao+xVxrmxsZD4IWnKl1UaZzI5lhAzr8fw6utHwx1EZ/MSgsEki6tujcZfN+GUDRnmJGQSnPTXmsf7Q4DKreTZk49cuyB3prV91S0x3DYjCUpSXrkVy1Ha5XicGD/q+ystuFsJnrrhbNXJbpSjM6sjo/aduAkZJl4FmOt0R7Q==",
* "userName": "example-user",
* }),
* },
* service_account=gcp.compute.InstanceServiceAccountArgs(
* scopes=[
* "userinfo-email",
* "compute-ro",
* "storage-ro",
* ],
* ))
* serial = pulumi.Output.all(windows.name, windows.zone).apply(lambda name, zone: gcp.compute.get_instance_serial_port_output(instance=name,
* zone=zone,
* port=4))
* pulumi.export("serialOut", serial.contents)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using System.Text.Json;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var windows = new Gcp.Compute.Instance("windows", new()
* {
* NetworkInterfaces = new[]
* {
* new Gcp.Compute.Inputs.InstanceNetworkInterfaceArgs
* {
* AccessConfigs = new[]
* {
* null,
* },
* Network = "default",
* },
* },
* Name = "windows-instance",
* MachineType = "e2-medium",
* Zone = "us-central1-a",
* BootDisk = new Gcp.Compute.Inputs.InstanceBootDiskArgs
* {
* InitializeParams = new Gcp.Compute.Inputs.InstanceBootDiskInitializeParamsArgs
* {
* Image = "windows-cloud/windows-2019",
* },
* },
* Metadata =
* {
* { "serial-port-logging-enable", "TRUE" },
* { "windows-keys", JsonSerializer.Serialize(new Dictionary
* {
* ["email"] = "[email protected]",
* ["expireOn"] = "2020-04-14T01:37:19Z",
* ["exponent"] = "AQAB",
* ["modulus"] = "wgsquN4IBNPqIUnu+h/5Za1kujb2YRhX1vCQVQAkBwnWigcCqOBVfRa5JoZfx6KIvEXjWqa77jPvlsxM4WPqnDIM2qiK36up3SKkYwFjff6F2ni/ry8vrwXCX3sGZ1hbIHlK0O012HpA3ISeEswVZmX2X67naOvJXfY5v0hGPWqCADao+xVxrmxsZD4IWnKl1UaZzI5lhAzr8fw6utHwx1EZ/MSgsEki6tujcZfN+GUDRnmJGQSnPTXmsf7Q4DKreTZk49cuyB3prV91S0x3DYjCUpSXrkVy1Ha5XicGD/q+ystuFsJnrrhbNXJbpSjM6sjo/aduAkZJl4FmOt0R7Q==",
* ["userName"] = "example-user",
* }) },
* },
* ServiceAccount = new Gcp.Compute.Inputs.InstanceServiceAccountArgs
* {
* Scopes = new[]
* {
* "userinfo-email",
* "compute-ro",
* "storage-ro",
* },
* },
* });
* var serial = Gcp.Compute.GetInstanceSerialPort.Invoke(new()
* {
* Instance = windows.Name,
* Zone = windows.Zone,
* Port = 4,
* });
* return new Dictionary
* {
* ["serialOut"] = serial.Apply(getInstanceSerialPortResult => getInstanceSerialPortResult.Contents),
* };
* });
* ```
* ```go
* package main
* import (
* "encoding/json"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* tmpJSON0, err := json.Marshal(map[string]interface{}{
* "email": "[email protected]",
* "expireOn": "2020-04-14T01:37:19Z",
* "exponent": "AQAB",
* "modulus": "wgsquN4IBNPqIUnu+h/5Za1kujb2YRhX1vCQVQAkBwnWigcCqOBVfRa5JoZfx6KIvEXjWqa77jPvlsxM4WPqnDIM2qiK36up3SKkYwFjff6F2ni/ry8vrwXCX3sGZ1hbIHlK0O012HpA3ISeEswVZmX2X67naOvJXfY5v0hGPWqCADao+xVxrmxsZD4IWnKl1UaZzI5lhAzr8fw6utHwx1EZ/MSgsEki6tujcZfN+GUDRnmJGQSnPTXmsf7Q4DKreTZk49cuyB3prV91S0x3DYjCUpSXrkVy1Ha5XicGD/q+ystuFsJnrrhbNXJbpSjM6sjo/aduAkZJl4FmOt0R7Q==",
* "userName": "example-user",
* })
* if err != nil {
* return err
* }
* json0 := string(tmpJSON0)
* windows, err := compute.NewInstance(ctx, "windows", &compute.InstanceArgs{
* NetworkInterfaces: compute.InstanceNetworkInterfaceArray{
* &compute.InstanceNetworkInterfaceArgs{
* AccessConfigs: compute.InstanceNetworkInterfaceAccessConfigArray{
* nil,
* },
* Network: pulumi.String("default"),
* },
* },
* Name: pulumi.String("windows-instance"),
* MachineType: pulumi.String("e2-medium"),
* Zone: pulumi.String("us-central1-a"),
* BootDisk: &compute.InstanceBootDiskArgs{
* InitializeParams: &compute.InstanceBootDiskInitializeParamsArgs{
* Image: pulumi.String("windows-cloud/windows-2019"),
* },
* },
* Metadata: pulumi.StringMap{
* "serial-port-logging-enable": pulumi.String("TRUE"),
* "windows-keys": pulumi.String(json0),
* },
* ServiceAccount: &compute.InstanceServiceAccountArgs{
* Scopes: pulumi.StringArray{
* pulumi.String("userinfo-email"),
* pulumi.String("compute-ro"),
* pulumi.String("storage-ro"),
* },
* },
* })
* if err != nil {
* return err
* }
* serial := pulumi.All(windows.Name, windows.Zone).ApplyT(func(_args []interface{}) (compute.GetInstanceSerialPortResult, error) {
* name := _args[0].(string)
* zone := _args[1].(string)
* return compute.GetInstanceSerialPortOutput(ctx, compute.GetInstanceSerialPortOutputArgs{
* Instance: name,
* Zone: zone,
* Port: 4,
* }, nil), nil
* }).(compute.GetInstanceSerialPortResultOutput)
* ctx.Export("serialOut", serial.ApplyT(func(serial compute.GetInstanceSerialPortResult) (*string, error) {
* return &serial.Contents, nil
* }).(pulumi.StringPtrOutput))
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.Instance;
* import com.pulumi.gcp.compute.InstanceArgs;
* import com.pulumi.gcp.compute.inputs.InstanceNetworkInterfaceArgs;
* import com.pulumi.gcp.compute.inputs.InstanceBootDiskArgs;
* import com.pulumi.gcp.compute.inputs.InstanceBootDiskInitializeParamsArgs;
* import com.pulumi.gcp.compute.inputs.InstanceServiceAccountArgs;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetInstanceSerialPortArgs;
* import static com.pulumi.codegen.internal.Serialization.*;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var windows = new Instance("windows", InstanceArgs.builder()
* .networkInterfaces(InstanceNetworkInterfaceArgs.builder()
* .accessConfigs()
* .network("default")
* .build())
* .name("windows-instance")
* .machineType("e2-medium")
* .zone("us-central1-a")
* .bootDisk(InstanceBootDiskArgs.builder()
* .initializeParams(InstanceBootDiskInitializeParamsArgs.builder()
* .image("windows-cloud/windows-2019")
* .build())
* .build())
* .metadata(Map.ofEntries(
* Map.entry("serial-port-logging-enable", "TRUE"),
* Map.entry("windows-keys", serializeJson(
* jsonObject(
* jsonProperty("email", "[email protected]"),
* jsonProperty("expireOn", "2020-04-14T01:37:19Z"),
* jsonProperty("exponent", "AQAB"),
* jsonProperty("modulus", "wgsquN4IBNPqIUnu+h/5Za1kujb2YRhX1vCQVQAkBwnWigcCqOBVfRa5JoZfx6KIvEXjWqa77jPvlsxM4WPqnDIM2qiK36up3SKkYwFjff6F2ni/ry8vrwXCX3sGZ1hbIHlK0O012HpA3ISeEswVZmX2X67naOvJXfY5v0hGPWqCADao+xVxrmxsZD4IWnKl1UaZzI5lhAzr8fw6utHwx1EZ/MSgsEki6tujcZfN+GUDRnmJGQSnPTXmsf7Q4DKreTZk49cuyB3prV91S0x3DYjCUpSXrkVy1Ha5XicGD/q+ystuFsJnrrhbNXJbpSjM6sjo/aduAkZJl4FmOt0R7Q=="),
* jsonProperty("userName", "example-user")
* )))
* ))
* .serviceAccount(InstanceServiceAccountArgs.builder()
* .scopes(
* "userinfo-email",
* "compute-ro",
* "storage-ro")
* .build())
* .build());
* final var serial = ComputeFunctions.getInstanceSerialPort(GetInstanceSerialPortArgs.builder()
* .instance(windows.name())
* .zone(windows.zone())
* .port(4)
* .build());
* ctx.export("serialOut", serial.applyValue(getInstanceSerialPortResult -> getInstanceSerialPortResult).applyValue(serial -> serial.applyValue(getInstanceSerialPortResult -> getInstanceSerialPortResult.contents())));
* }
* }
* ```
* ```yaml
* resources:
* windows:
* type: gcp:compute:Instance
* properties:
* networkInterfaces:
* - accessConfigs:
* - {}
* network: default
* name: windows-instance
* machineType: e2-medium
* zone: us-central1-a
* bootDisk:
* initializeParams:
* image: windows-cloud/windows-2019
* metadata:
* serial-port-logging-enable: TRUE
* windows-keys:
* fn::toJSON:
* email: [email protected]
* expireOn: 2020-04-14T01:37:19Z
* exponent: AQAB
* modulus: wgsquN4IBNPqIUnu+h/5Za1kujb2YRhX1vCQVQAkBwnWigcCqOBVfRa5JoZfx6KIvEXjWqa77jPvlsxM4WPqnDIM2qiK36up3SKkYwFjff6F2ni/ry8vrwXCX3sGZ1hbIHlK0O012HpA3ISeEswVZmX2X67naOvJXfY5v0hGPWqCADao+xVxrmxsZD4IWnKl1UaZzI5lhAzr8fw6utHwx1EZ/MSgsEki6tujcZfN+GUDRnmJGQSnPTXmsf7Q4DKreTZk49cuyB3prV91S0x3DYjCUpSXrkVy1Ha5XicGD/q+ystuFsJnrrhbNXJbpSjM6sjo/aduAkZJl4FmOt0R7Q==
* userName: example-user
* serviceAccount:
* scopes:
* - userinfo-email
* - compute-ro
* - storage-ro
* variables:
* serial:
* fn::invoke:
* Function: gcp:compute:getInstanceSerialPort
* Arguments:
* instance: ${windows.name}
* zone: ${windows.zone}
* port: 4
* outputs:
* serialOut: ${serial.contents}
* ```
*
* @param argument A collection of arguments for invoking getInstanceSerialPort.
* @return A collection of values returned by getInstanceSerialPort.
*/
public suspend fun getInstanceSerialPort(argument: GetInstanceSerialPortPlainArgs): GetInstanceSerialPortResult =
getInstanceSerialPortResultToKotlin(getInstanceSerialPortPlain(argument.toJava()).await())
/**
* @see [getInstanceSerialPort].
* @param instance The name of the Compute Instance to read output from.
* @param port The number of the serial port to read output from. Possible values are 1-4.
* - - -
* @param project The project in which the Compute Instance exists. If it
* is not provided, the provider project is used.
* @param zone The zone in which the Compute Instance exists.
* If it is not provided, the provider zone is used.
* @return A collection of values returned by getInstanceSerialPort.
*/
public suspend fun getInstanceSerialPort(
instance: String,
port: Int,
project: String? = null,
zone: String? = null,
): GetInstanceSerialPortResult {
val argument = GetInstanceSerialPortPlainArgs(
instance = instance,
port = port,
project = project,
zone = zone,
)
return getInstanceSerialPortResultToKotlin(getInstanceSerialPortPlain(argument.toJava()).await())
}
/**
* @see [getInstanceSerialPort].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetInstanceSerialPortPlainArgs].
* @return A collection of values returned by getInstanceSerialPort.
*/
public suspend fun getInstanceSerialPort(argument: suspend GetInstanceSerialPortPlainArgsBuilder.() -> Unit): GetInstanceSerialPortResult {
val builder = GetInstanceSerialPortPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getInstanceSerialPortResultToKotlin(getInstanceSerialPortPlain(builtArgument.toJava()).await())
}
/**
* > **Note**: Global instance templates can be used in any region. To lower the impact of outages outside your region and gain data residency within your region, use google_compute_region_instance_template.
* Get information about a VM instance template resource within GCE. For more information see
* [the official documentation](https://cloud.google.com/compute/docs/instance-templates)
* and
* [API](https://cloud.google.com/compute/docs/reference/rest/v1/instanceTemplates).
* @param argument A collection of arguments for invoking getInstanceTemplate.
* @return A collection of values returned by getInstanceTemplate.
*/
public suspend fun getInstanceTemplate(argument: GetInstanceTemplatePlainArgs): GetInstanceTemplateResult =
getInstanceTemplateResultToKotlin(getInstanceTemplatePlain(argument.toJava()).await())
/**
* @see [getInstanceTemplate].
* @param filter A filter to retrieve the instance templates.
* See [gcloud topic filters](https://cloud.google.com/sdk/gcloud/reference/topic/filters) for reference.
* If multiple instance templates match, either adjust the filter or specify `most_recent`.
* One of `name`, `filter` or `self_link_unique` must be provided.
* @param mostRecent If `filter` is provided, ensures the most recent template is returned when multiple instance templates match. One of `name`, `filter` or `self_link_unique` must be provided.
* @param name The name of the instance template. One of `name`, `filter` or `self_link_unique` must be provided.
* @param project The ID of the project in which the resource belongs.
* If `project` is not provided, the provider project is used.
* @param selfLinkUnique The self_link_unique URI of the instance template. One of `name`, `filter` or `self_link_unique` must be provided.
* @return A collection of values returned by getInstanceTemplate.
*/
public suspend fun getInstanceTemplate(
filter: String? = null,
mostRecent: Boolean? = null,
name: String? = null,
project: String? = null,
selfLinkUnique: String? = null,
): GetInstanceTemplateResult {
val argument = GetInstanceTemplatePlainArgs(
filter = filter,
mostRecent = mostRecent,
name = name,
project = project,
selfLinkUnique = selfLinkUnique,
)
return getInstanceTemplateResultToKotlin(getInstanceTemplatePlain(argument.toJava()).await())
}
/**
* @see [getInstanceTemplate].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetInstanceTemplatePlainArgs].
* @return A collection of values returned by getInstanceTemplate.
*/
public suspend fun getInstanceTemplate(argument: suspend GetInstanceTemplatePlainArgsBuilder.() -> Unit): GetInstanceTemplateResult {
val builder = GetInstanceTemplatePlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getInstanceTemplateResultToKotlin(getInstanceTemplatePlain(builtArgument.toJava()).await())
}
/**
* Use this data source to access IP ranges in your firewall rules.
* https://cloud.google.com/compute/docs/load-balancing/health-checks#health_check_source_ips_and_firewall_rules
* ## Example Usage
* ```tf
* data "google_compute_lb_ip_ranges" "ranges" {
* }
* resource "google_compute_firewall" "lb" {
* name = "lb-firewall"
* network = google_compute_network.main.name
* allow {
* protocol = "tcp"
* ports = ["80"]
* }
* source_ranges = data.google_compute_lb_ip_ranges.ranges.network
* target_tags = [
* "InstanceBehindLoadBalancer",
* ]
* }
* ```
* @param argument Use this data source to access IP ranges in your firewall rules.
* https://cloud.google.com/compute/docs/load-balancing/health-checks#health_check_source_ips_and_firewall_rules
* ## Example Usage
* ```tf
* data "google_compute_lb_ip_ranges" "ranges" {
* }
* resource "google_compute_firewall" "lb" {
* name = "lb-firewall"
* network = google_compute_network.main.name
* allow {
* protocol = "tcp"
* ports = ["80"]
* }
* source_ranges = data.google_compute_lb_ip_ranges.ranges.network
* target_tags = [
* "InstanceBehindLoadBalancer",
* ]
* }
* ```
* @return A collection of values returned by getLBIPRanges.
*/
public suspend fun getLBIPRanges(): GetLBIPRangesResult =
getLBIPRangesResultToKotlin(getLBIPRangesPlain().await())
/**
*
* @param argument A collection of arguments for invoking getMachineImageIamPolicy.
* @return A collection of values returned by getMachineImageIamPolicy.
*/
public suspend fun getMachineImageIamPolicy(argument: GetMachineImageIamPolicyPlainArgs): GetMachineImageIamPolicyResult =
getMachineImageIamPolicyResultToKotlin(getMachineImageIamPolicyPlain(argument.toJava()).await())
/**
* @see [getMachineImageIamPolicy].
* @param machineImage Used to find the parent resource to bind the IAM policy to
* @param project The ID of the project in which the resource belongs.
* If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
* @return A collection of values returned by getMachineImageIamPolicy.
*/
public suspend fun getMachineImageIamPolicy(machineImage: String, project: String? = null): GetMachineImageIamPolicyResult {
val argument = GetMachineImageIamPolicyPlainArgs(
machineImage = machineImage,
project = project,
)
return getMachineImageIamPolicyResultToKotlin(getMachineImageIamPolicyPlain(argument.toJava()).await())
}
/**
* @see [getMachineImageIamPolicy].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetMachineImageIamPolicyPlainArgs].
* @return A collection of values returned by getMachineImageIamPolicy.
*/
public suspend fun getMachineImageIamPolicy(argument: suspend GetMachineImageIamPolicyPlainArgsBuilder.() -> Unit): GetMachineImageIamPolicyResult {
val builder = GetMachineImageIamPolicyPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getMachineImageIamPolicyResultToKotlin(getMachineImageIamPolicyPlain(builtArgument.toJava()).await())
}
/**
* Provides access to available Google Compute machine types in a zone for a given project.
* See more about [machine type availability](https://cloud.google.com/compute/docs/regions-zones#available) in the upstream docs.
* To get more information about machine types, see:
* * [API Documentation](https://cloud.google.com/compute/docs/reference/rest/v1/machineTypes/list)
* * [Comparison Guide](https://cloud.google.com/compute/docs/machine-resource)
* ## Example Usage
* @param argument A collection of arguments for invoking getMachineTypes.
* @return A collection of values returned by getMachineTypes.
*/
public suspend fun getMachineTypes(argument: GetMachineTypesPlainArgs): GetMachineTypesResult =
getMachineTypesResultToKotlin(getMachineTypesPlain(argument.toJava()).await())
/**
* @see [getMachineTypes].
* @param filter A filter expression that filters machine types listed in the response.
* @param project Project from which to list available zones. Defaults to project declared in the provider.
* @param zone Zone from which to list machine types.
* @return A collection of values returned by getMachineTypes.
*/
public suspend fun getMachineTypes(
filter: String? = null,
project: String? = null,
zone: String? = null,
): GetMachineTypesResult {
val argument = GetMachineTypesPlainArgs(
filter = filter,
project = project,
zone = zone,
)
return getMachineTypesResultToKotlin(getMachineTypesPlain(argument.toJava()).await())
}
/**
* @see [getMachineTypes].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetMachineTypesPlainArgs].
* @return A collection of values returned by getMachineTypes.
*/
public suspend fun getMachineTypes(argument: suspend GetMachineTypesPlainArgsBuilder.() -> Unit): GetMachineTypesResult {
val builder = GetMachineTypesPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getMachineTypesResultToKotlin(getMachineTypesPlain(builtArgument.toJava()).await())
}
/**
* Use this data source to get the IP addresses from different special IP ranges on Google Cloud Platform.
* ## Example Usage
* ### Cloud Ranges
* ```tf
* data "google_netblock_ip_ranges" "netblock" {
* }
* output "cidr_blocks" {
* value = data.google_netblock_ip_ranges.netblock.cidr_blocks
* }
* output "cidr_blocks_ipv4" {
* value = data.google_netblock_ip_ranges.netblock.cidr_blocks_ipv4
* }
* output "cidr_blocks_ipv6" {
* value = data.google_netblock_ip_ranges.netblock.cidr_blocks_ipv6
* }
* ```
* ### Allow Health Checks
* ```tf
* data "google_netblock_ip_ranges" "legacy-hcs" {
* range_type = "legacy-health-checkers"
* }
* resource "google_compute_firewall" "allow-hcs" {
* name = "allow-hcs"
* network = google_compute_network.default.name
* allow {
* protocol = "tcp"
* ports = ["80"]
* }
* source_ranges = data.google_netblock_ip_ranges.legacy-hcs.cidr_blocks_ipv4
* }
* resource "google_compute_network" "default" {
* name = "test-network"
* }
* ```
* @param argument A collection of arguments for invoking getNetblockIPRanges.
* @return A collection of values returned by getNetblockIPRanges.
*/
public suspend fun getNetblockIPRanges(argument: GetNetblockIPRangesPlainArgs): GetNetblockIPRangesResult =
getNetblockIPRangesResultToKotlin(getNetblockIPRangesPlain(argument.toJava()).await())
/**
* @see [getNetblockIPRanges].
* @param rangeType The type of range for which to provide results.
* Defaults to `cloud-netblocks`. The following `range_type`s are supported:
* * `cloud-netblocks` - Corresponds to the IP addresses used for resources on Google Cloud Platform. [More details.](https://cloud.google.com/compute/docs/faq#where_can_i_find_product_name_short_ip_ranges)
* * `google-netblocks` - Corresponds to IP addresses used for Google services. [More details.](https://cloud.google.com/compute/docs/faq#where_can_i_find_product_name_short_ip_ranges)
* * `restricted-googleapis` - Corresponds to the IP addresses used for Private Google Access only for services that support VPC Service Controls API access. [More details.](https://cloud.google.com/vpc/docs/private-access-options#domain-vips)
* * `private-googleapis` - Corresponds to the IP addresses used for Private Google Access for services that do not support VPC Service Controls. [More details.](https://cloud.google.com/vpc/docs/private-access-options#domain-vips)
* * `dns-forwarders` - Corresponds to the IP addresses used to originate Cloud DNS outbound forwarding. [More details.](https://cloud.google.com/dns/zones/#creating-forwarding-zones)
* * `iap-forwarders` - Corresponds to the IP addresses used for Cloud IAP for TCP forwarding. [More details.](https://cloud.google.com/iap/docs/using-tcp-forwarding)
* * `health-checkers` - Corresponds to the IP addresses used for health checking in Cloud Load Balancing. [More details.](https://cloud.google.com/load-balancing/docs/health-checks)
* * `legacy-health-checkers` - Corresponds to the IP addresses used for legacy style health checkers (used by Network Load Balancing). [ More details.](https://cloud.google.com/load-balancing/docs/health-checks)
* @return A collection of values returned by getNetblockIPRanges.
*/
public suspend fun getNetblockIPRanges(rangeType: String? = null): GetNetblockIPRangesResult {
val argument = GetNetblockIPRangesPlainArgs(
rangeType = rangeType,
)
return getNetblockIPRangesResultToKotlin(getNetblockIPRangesPlain(argument.toJava()).await())
}
/**
* @see [getNetblockIPRanges].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetNetblockIPRangesPlainArgs].
* @return A collection of values returned by getNetblockIPRanges.
*/
public suspend fun getNetblockIPRanges(argument: suspend GetNetblockIPRangesPlainArgsBuilder.() -> Unit): GetNetblockIPRangesResult {
val builder = GetNetblockIPRangesPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getNetblockIPRangesResultToKotlin(getNetblockIPRangesPlain(builtArgument.toJava()).await())
}
/**
* Get a network within GCE from its name.
* ## Example Usage
* ```tf
* data "google_compute_network" "my-network" {
* name = "default-us-east1"
* }
* ```
* @param argument A collection of arguments for invoking getNetwork.
* @return A collection of values returned by getNetwork.
*/
public suspend fun getNetwork(argument: GetNetworkPlainArgs): GetNetworkResult =
getNetworkResultToKotlin(getNetworkPlain(argument.toJava()).await())
/**
* @see [getNetwork].
* @param name The name of the network.
* - - -
* @param project The ID of the project in which the resource belongs. If it
* is not provided, the provider project is used.
* @return A collection of values returned by getNetwork.
*/
public suspend fun getNetwork(name: String, project: String? = null): GetNetworkResult {
val argument = GetNetworkPlainArgs(
name = name,
project = project,
)
return getNetworkResultToKotlin(getNetworkPlain(argument.toJava()).await())
}
/**
* @see [getNetwork].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetNetworkPlainArgs].
* @return A collection of values returned by getNetwork.
*/
public suspend fun getNetwork(argument: suspend GetNetworkPlainArgsBuilder.() -> Unit): GetNetworkResult {
val builder = GetNetworkPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getNetworkResultToKotlin(getNetworkPlain(builtArgument.toJava()).await())
}
/**
* Use this data source to access a Network Endpoint Group's attributes.
* The NEG may be found by providing either a `self_link`, or a `name` and a `zone`.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const neg1 = gcp.compute.getNetworkEndpointGroup({
* name: "k8s1-abcdef01-myns-mysvc-8080-4b6bac43",
* zone: "us-central1-a",
* });
* const neg2 = gcp.compute.getNetworkEndpointGroup({
* selfLink: "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/networkEndpointGroups/k8s1-abcdef01-myns-mysvc-8080-4b6bac43",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* neg1 = gcp.compute.get_network_endpoint_group(name="k8s1-abcdef01-myns-mysvc-8080-4b6bac43",
* zone="us-central1-a")
* neg2 = gcp.compute.get_network_endpoint_group(self_link="https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/networkEndpointGroups/k8s1-abcdef01-myns-mysvc-8080-4b6bac43")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var neg1 = Gcp.Compute.GetNetworkEndpointGroup.Invoke(new()
* {
* Name = "k8s1-abcdef01-myns-mysvc-8080-4b6bac43",
* Zone = "us-central1-a",
* });
* var neg2 = Gcp.Compute.GetNetworkEndpointGroup.Invoke(new()
* {
* SelfLink = "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/networkEndpointGroups/k8s1-abcdef01-myns-mysvc-8080-4b6bac43",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.LookupNetworkEndpointGroup(ctx, &compute.LookupNetworkEndpointGroupArgs{
* Name: pulumi.StringRef("k8s1-abcdef01-myns-mysvc-8080-4b6bac43"),
* Zone: pulumi.StringRef("us-central1-a"),
* }, nil)
* if err != nil {
* return err
* }
* _, err = compute.LookupNetworkEndpointGroup(ctx, &compute.LookupNetworkEndpointGroupArgs{
* SelfLink: pulumi.StringRef("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/networkEndpointGroups/k8s1-abcdef01-myns-mysvc-8080-4b6bac43"),
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetNetworkEndpointGroupArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var neg1 = ComputeFunctions.getNetworkEndpointGroup(GetNetworkEndpointGroupArgs.builder()
* .name("k8s1-abcdef01-myns-mysvc-8080-4b6bac43")
* .zone("us-central1-a")
* .build());
* final var neg2 = ComputeFunctions.getNetworkEndpointGroup(GetNetworkEndpointGroupArgs.builder()
* .selfLink("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/networkEndpointGroups/k8s1-abcdef01-myns-mysvc-8080-4b6bac43")
* .build());
* }
* }
* ```
* ```yaml
* variables:
* neg1:
* fn::invoke:
* Function: gcp:compute:getNetworkEndpointGroup
* Arguments:
* name: k8s1-abcdef01-myns-mysvc-8080-4b6bac43
* zone: us-central1-a
* neg2:
* fn::invoke:
* Function: gcp:compute:getNetworkEndpointGroup
* Arguments:
* selfLink: https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/networkEndpointGroups/k8s1-abcdef01-myns-mysvc-8080-4b6bac43
* ```
*
* @param argument A collection of arguments for invoking getNetworkEndpointGroup.
* @return A collection of values returned by getNetworkEndpointGroup.
*/
public suspend fun getNetworkEndpointGroup(argument: GetNetworkEndpointGroupPlainArgs): GetNetworkEndpointGroupResult =
getNetworkEndpointGroupResultToKotlin(getNetworkEndpointGroupPlain(argument.toJava()).await())
/**
* @see [getNetworkEndpointGroup].
* @param name The Network Endpoint Group name.
* Provide either this or a `self_link`.
* @param project The ID of the project to list versions in.
* If it is not provided, the provider project is used.
* @param selfLink The Network Endpoint Group self_link.
* @param zone The Network Endpoint Group availability zone.
* @return A collection of values returned by getNetworkEndpointGroup.
*/
public suspend fun getNetworkEndpointGroup(
name: String? = null,
project: String? = null,
selfLink: String? = null,
zone: String? = null,
): GetNetworkEndpointGroupResult {
val argument = GetNetworkEndpointGroupPlainArgs(
name = name,
project = project,
selfLink = selfLink,
zone = zone,
)
return getNetworkEndpointGroupResultToKotlin(getNetworkEndpointGroupPlain(argument.toJava()).await())
}
/**
* @see [getNetworkEndpointGroup].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetNetworkEndpointGroupPlainArgs].
* @return A collection of values returned by getNetworkEndpointGroup.
*/
public suspend fun getNetworkEndpointGroup(argument: suspend GetNetworkEndpointGroupPlainArgsBuilder.() -> Unit): GetNetworkEndpointGroupResult {
val builder = GetNetworkEndpointGroupPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getNetworkEndpointGroupResultToKotlin(getNetworkEndpointGroupPlain(builtArgument.toJava()).await())
}
/**
* Get information of a specified compute network peering. For more information see
* [the official documentation](https://cloud.google.com/compute/docs/vpc/vpc-peering)
* and
* [API](https://cloud.google.com/compute/docs/reference/latest/networks).
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const _default = new gcp.compute.Network("default", {
* name: "foobar",
* autoCreateSubnetworks: false,
* });
* const other = new gcp.compute.Network("other", {
* name: "other",
* autoCreateSubnetworks: false,
* });
* const peering1 = new gcp.compute.NetworkPeering("peering1", {
* name: "peering1",
* network: _default.selfLink,
* peerNetwork: other.selfLink,
* });
* const peering2 = new gcp.compute.NetworkPeering("peering2", {
* name: "peering2",
* network: other.selfLink,
* peerNetwork: _default.selfLink,
* });
* const peering1Ds = gcp.compute.getNetworkPeeringOutput({
* name: peering1.name,
* network: peering1.network,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default = gcp.compute.Network("default",
* name="foobar",
* auto_create_subnetworks=False)
* other = gcp.compute.Network("other",
* name="other",
* auto_create_subnetworks=False)
* peering1 = gcp.compute.NetworkPeering("peering1",
* name="peering1",
* network=default.self_link,
* peer_network=other.self_link)
* peering2 = gcp.compute.NetworkPeering("peering2",
* name="peering2",
* network=other.self_link,
* peer_network=default.self_link)
* peering1_ds = gcp.compute.get_network_peering_output(name=peering1.name,
* network=peering1.network)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var @default = new Gcp.Compute.Network("default", new()
* {
* Name = "foobar",
* AutoCreateSubnetworks = false,
* });
* var other = new Gcp.Compute.Network("other", new()
* {
* Name = "other",
* AutoCreateSubnetworks = false,
* });
* var peering1 = new Gcp.Compute.NetworkPeering("peering1", new()
* {
* Name = "peering1",
* Network = @default.SelfLink,
* PeerNetwork = other.SelfLink,
* });
* var peering2 = new Gcp.Compute.NetworkPeering("peering2", new()
* {
* Name = "peering2",
* Network = other.SelfLink,
* PeerNetwork = @default.SelfLink,
* });
* var peering1Ds = Gcp.Compute.GetNetworkPeering.Invoke(new()
* {
* Name = peering1.Name,
* Network = peering1.Network,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.NewNetwork(ctx, "default", &compute.NetworkArgs{
* Name: pulumi.String("foobar"),
* AutoCreateSubnetworks: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* other, err := compute.NewNetwork(ctx, "other", &compute.NetworkArgs{
* Name: pulumi.String("other"),
* AutoCreateSubnetworks: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* peering1, err := compute.NewNetworkPeering(ctx, "peering1", &compute.NetworkPeeringArgs{
* Name: pulumi.String("peering1"),
* Network: _default.SelfLink,
* PeerNetwork: other.SelfLink,
* })
* if err != nil {
* return err
* }
* _, err = compute.NewNetworkPeering(ctx, "peering2", &compute.NetworkPeeringArgs{
* Name: pulumi.String("peering2"),
* Network: other.SelfLink,
* PeerNetwork: _default.SelfLink,
* })
* if err != nil {
* return err
* }
* _ = compute.LookupNetworkPeeringOutput(ctx, compute.GetNetworkPeeringOutputArgs{
* Name: peering1.Name,
* Network: peering1.Network,
* }, nil)
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.Network;
* import com.pulumi.gcp.compute.NetworkArgs;
* import com.pulumi.gcp.compute.NetworkPeering;
* import com.pulumi.gcp.compute.NetworkPeeringArgs;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetNetworkPeeringArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var default_ = new Network("default", NetworkArgs.builder()
* .name("foobar")
* .autoCreateSubnetworks("false")
* .build());
* var other = new Network("other", NetworkArgs.builder()
* .name("other")
* .autoCreateSubnetworks("false")
* .build());
* var peering1 = new NetworkPeering("peering1", NetworkPeeringArgs.builder()
* .name("peering1")
* .network(default_.selfLink())
* .peerNetwork(other.selfLink())
* .build());
* var peering2 = new NetworkPeering("peering2", NetworkPeeringArgs.builder()
* .name("peering2")
* .network(other.selfLink())
* .peerNetwork(default_.selfLink())
* .build());
* final var peering1Ds = ComputeFunctions.getNetworkPeering(GetNetworkPeeringArgs.builder()
* .name(peering1.name())
* .network(peering1.network())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* peering1:
* type: gcp:compute:NetworkPeering
* properties:
* name: peering1
* network: ${default.selfLink}
* peerNetwork: ${other.selfLink}
* peering2:
* type: gcp:compute:NetworkPeering
* properties:
* name: peering2
* network: ${other.selfLink}
* peerNetwork: ${default.selfLink}
* default:
* type: gcp:compute:Network
* properties:
* name: foobar
* autoCreateSubnetworks: 'false'
* other:
* type: gcp:compute:Network
* properties:
* name: other
* autoCreateSubnetworks: 'false'
* variables:
* peering1Ds:
* fn::invoke:
* Function: gcp:compute:getNetworkPeering
* Arguments:
* name: ${peering1.name}
* network: ${peering1.network}
* ```
*
* @param argument A collection of arguments for invoking getNetworkPeering.
* @return A collection of values returned by getNetworkPeering.
*/
public suspend fun getNetworkPeering(argument: GetNetworkPeeringPlainArgs): GetNetworkPeeringResult =
getNetworkPeeringResultToKotlin(getNetworkPeeringPlain(argument.toJava()).await())
/**
* @see [getNetworkPeering].
* @param name Name of the peering.
* @param network The primary network of the peering.
* @return A collection of values returned by getNetworkPeering.
*/
public suspend fun getNetworkPeering(name: String, network: String): GetNetworkPeeringResult {
val argument = GetNetworkPeeringPlainArgs(
name = name,
network = network,
)
return getNetworkPeeringResultToKotlin(getNetworkPeeringPlain(argument.toJava()).await())
}
/**
* @see [getNetworkPeering].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetNetworkPeeringPlainArgs].
* @return A collection of values returned by getNetworkPeering.
*/
public suspend fun getNetworkPeering(argument: suspend GetNetworkPeeringPlainArgsBuilder.() -> Unit): GetNetworkPeeringResult {
val builder = GetNetworkPeeringPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getNetworkPeeringResultToKotlin(getNetworkPeeringPlain(builtArgument.toJava()).await())
}
/**
* List all networks in a specified Google Cloud project.
* ## Example Usage
* ```tf
* data "google_compute_networks" "my-networks" {
* project = "my-cloud-project"
* }
* ```
* @param argument A collection of arguments for invoking getNetworks.
* @return A collection of values returned by getNetworks.
*/
public suspend fun getNetworks(argument: GetNetworksPlainArgs): GetNetworksResult =
getNetworksResultToKotlin(getNetworksPlain(argument.toJava()).await())
/**
* @see [getNetworks].
* @param project The name of the project.
* @return A collection of values returned by getNetworks.
*/
public suspend fun getNetworks(project: String? = null): GetNetworksResult {
val argument = GetNetworksPlainArgs(
project = project,
)
return getNetworksResultToKotlin(getNetworksPlain(argument.toJava()).await())
}
/**
* @see [getNetworks].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetNetworksPlainArgs].
* @return A collection of values returned by getNetworks.
*/
public suspend fun getNetworks(argument: suspend GetNetworksPlainArgsBuilder.() -> Unit): GetNetworksResult {
val builder = GetNetworksPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getNetworksResultToKotlin(getNetworksPlain(builtArgument.toJava()).await())
}
/**
* Provides available node types for Compute Engine sole-tenant nodes in a zone
* for a given project. For more information, see [the official documentation](https://cloud.google.com/compute/docs/nodes/#types) and [API](https://cloud.google.com/compute/docs/reference/rest/v1/nodeTypes).
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const central1b = gcp.compute.getNodeTypes({
* zone: "us-central1-b",
* });
* const tmpl = new gcp.compute.NodeTemplate("tmpl", {
* name: "test-tmpl",
* region: "us-central1",
* nodeType: types.names[0],
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* central1b = gcp.compute.get_node_types(zone="us-central1-b")
* tmpl = gcp.compute.NodeTemplate("tmpl",
* name="test-tmpl",
* region="us-central1",
* node_type=types["names"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var central1b = Gcp.Compute.GetNodeTypes.Invoke(new()
* {
* Zone = "us-central1-b",
* });
* var tmpl = new Gcp.Compute.NodeTemplate("tmpl", new()
* {
* Name = "test-tmpl",
* Region = "us-central1",
* NodeType = types.Names[0],
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.GetNodeTypes(ctx, &compute.GetNodeTypesArgs{
* Zone: pulumi.StringRef("us-central1-b"),
* }, nil)
* if err != nil {
* return err
* }
* _, err = compute.NewNodeTemplate(ctx, "tmpl", &compute.NodeTemplateArgs{
* Name: pulumi.String("test-tmpl"),
* Region: pulumi.String("us-central1"),
* NodeType: pulumi.Any(types.Names[0]),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetNodeTypesArgs;
* import com.pulumi.gcp.compute.NodeTemplate;
* import com.pulumi.gcp.compute.NodeTemplateArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var central1b = ComputeFunctions.getNodeTypes(GetNodeTypesArgs.builder()
* .zone("us-central1-b")
* .build());
* var tmpl = new NodeTemplate("tmpl", NodeTemplateArgs.builder()
* .name("test-tmpl")
* .region("us-central1")
* .nodeType(types.names()[0])
* .build());
* }
* }
* ```
* ```yaml
* resources:
* tmpl:
* type: gcp:compute:NodeTemplate
* properties:
* name: test-tmpl
* region: us-central1
* nodeType: ${types.names[0]}
* variables:
* central1b:
* fn::invoke:
* Function: gcp:compute:getNodeTypes
* Arguments:
* zone: us-central1-b
* ```
*
* @param argument A collection of arguments for invoking getNodeTypes.
* @return A collection of values returned by getNodeTypes.
*/
public suspend fun getNodeTypes(argument: GetNodeTypesPlainArgs): GetNodeTypesResult =
getNodeTypesResultToKotlin(getNodeTypesPlain(argument.toJava()).await())
/**
* @see [getNodeTypes].
* @param project ID of the project to list available node types for.
* Should match the project the nodes of this type will be deployed to.
* Defaults to the project that the provider is authenticated with.
* @param zone The zone to list node types for. Should be in zone of intended node groups and region of referencing node template. If `zone` is not specified, the provider-level zone must be set and is used
* instead.
* @return A collection of values returned by getNodeTypes.
*/
public suspend fun getNodeTypes(project: String? = null, zone: String? = null): GetNodeTypesResult {
val argument = GetNodeTypesPlainArgs(
project = project,
zone = zone,
)
return getNodeTypesResultToKotlin(getNodeTypesPlain(argument.toJava()).await())
}
/**
* @see [getNodeTypes].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetNodeTypesPlainArgs].
* @return A collection of values returned by getNodeTypes.
*/
public suspend fun getNodeTypes(argument: suspend GetNodeTypesPlainArgsBuilder.() -> Unit): GetNodeTypesResult {
val builder = GetNodeTypesPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getNodeTypesResultToKotlin(getNodeTypesPlain(builtArgument.toJava()).await())
}
/**
*
* @param argument A collection of arguments for invoking getRegionBackendServiceIamPolicy.
* @return A collection of values returned by getRegionBackendServiceIamPolicy.
*/
public suspend fun getRegionBackendServiceIamPolicy(argument: GetRegionBackendServiceIamPolicyPlainArgs): GetRegionBackendServiceIamPolicyResult =
getRegionBackendServiceIamPolicyResultToKotlin(getRegionBackendServiceIamPolicyPlain(argument.toJava()).await())
/**
* @see [getRegionBackendServiceIamPolicy].
* @param name Used to find the parent resource to bind the IAM policy to
* @param project The ID of the project in which the resource belongs.
* If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
* @param region The Region in which the created backend service should reside.
* If it is not provided, the provider region is used.
* Used to find the parent resource to bind the IAM policy to. If not specified,
* the value will be parsed from the identifier of the parent resource. If no region is provided in the parent identifier and no
* region is specified, it is taken from the provider configuration.
* @return A collection of values returned by getRegionBackendServiceIamPolicy.
*/
public suspend fun getRegionBackendServiceIamPolicy(
name: String,
project: String? = null,
region: String? = null,
): GetRegionBackendServiceIamPolicyResult {
val argument = GetRegionBackendServiceIamPolicyPlainArgs(
name = name,
project = project,
region = region,
)
return getRegionBackendServiceIamPolicyResultToKotlin(getRegionBackendServiceIamPolicyPlain(argument.toJava()).await())
}
/**
* @see [getRegionBackendServiceIamPolicy].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetRegionBackendServiceIamPolicyPlainArgs].
* @return A collection of values returned by getRegionBackendServiceIamPolicy.
*/
public suspend fun getRegionBackendServiceIamPolicy(argument: suspend GetRegionBackendServiceIamPolicyPlainArgsBuilder.() -> Unit): GetRegionBackendServiceIamPolicyResult {
val builder = GetRegionBackendServiceIamPolicyPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getRegionBackendServiceIamPolicyResultToKotlin(getRegionBackendServiceIamPolicyPlain(builtArgument.toJava()).await())
}
/**
* Get information about a Google Compute Regional Persistent disks.
* [the official documentation](https://cloud.google.com/compute/docs/disks) and its [API](https://cloud.google.com/compute/docs/reference/rest/v1/regionDisks).
* ## Example Usage
*
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetRegionDiskArgs;
* import com.pulumi.gcp.compute.Instance;
* import com.pulumi.gcp.compute.InstanceArgs;
* import com.pulumi.gcp.compute.inputs.InstanceAttachedDiskArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var disk = ComputeFunctions.getRegionDisk(GetRegionDiskArgs.builder()
* .name("persistent-regional-disk")
* .project("example")
* .region("us-central1")
* .type("pd-ssd")
* .physicalBlockSizeBytes(4096)
* .replicaZones(
* "us-central1-a",
* "us-central1-f")
* .build());
* var default_ = new Instance("default", InstanceArgs.builder()
* .attachedDisks(InstanceAttachedDiskArgs.builder()
* .source(diskGoogleComputeDisk.selfLink())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:compute:Instance
* properties:
* attachedDisks:
* - source: ${diskGoogleComputeDisk.selfLink}
* variables:
* disk:
* fn::invoke:
* Function: gcp:compute:getRegionDisk
* Arguments:
* name: persistent-regional-disk
* project: example
* region: us-central1
* type: pd-ssd
* physicalBlockSizeBytes: 4096
* replicaZones:
* - us-central1-a
* - us-central1-f
* ```
*
* @param argument A collection of arguments for invoking getRegionDisk.
* @return A collection of values returned by getRegionDisk.
*/
public suspend fun getRegionDisk(argument: GetRegionDiskPlainArgs): GetRegionDiskResult =
getRegionDiskResultToKotlin(getRegionDiskPlain(argument.toJava()).await())
/**
* @see [getRegionDisk].
* @param name The name of a specific disk.
* - - -
* @param project The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
* @param region A reference to the region where the disk resides.
* @return A collection of values returned by getRegionDisk.
*/
public suspend fun getRegionDisk(
name: String,
project: String? = null,
region: String? = null,
): GetRegionDiskResult {
val argument = GetRegionDiskPlainArgs(
name = name,
project = project,
region = region,
)
return getRegionDiskResultToKotlin(getRegionDiskPlain(argument.toJava()).await())
}
/**
* @see [getRegionDisk].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetRegionDiskPlainArgs].
* @return A collection of values returned by getRegionDisk.
*/
public suspend fun getRegionDisk(argument: suspend GetRegionDiskPlainArgsBuilder.() -> Unit): GetRegionDiskResult {
val builder = GetRegionDiskPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getRegionDiskResultToKotlin(getRegionDiskPlain(builtArgument.toJava()).await())
}
/**
* Retrieves the current IAM policy data for regiondisk
* ## example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const policy = gcp.compute.getRegionDiskIamPolicy({
* project: regiondisk.project,
* region: regiondisk.region,
* name: regiondisk.name,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* policy = gcp.compute.get_region_disk_iam_policy(project=regiondisk["project"],
* region=regiondisk["region"],
* name=regiondisk["name"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var policy = Gcp.Compute.GetRegionDiskIamPolicy.Invoke(new()
* {
* Project = regiondisk.Project,
* Region = regiondisk.Region,
* Name = regiondisk.Name,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.LookupRegionDiskIamPolicy(ctx, &compute.LookupRegionDiskIamPolicyArgs{
* Project: pulumi.StringRef(regiondisk.Project),
* Region: pulumi.StringRef(regiondisk.Region),
* Name: regiondisk.Name,
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetRegionDiskIamPolicyArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var policy = ComputeFunctions.getRegionDiskIamPolicy(GetRegionDiskIamPolicyArgs.builder()
* .project(regiondisk.project())
* .region(regiondisk.region())
* .name(regiondisk.name())
* .build());
* }
* }
* ```
* ```yaml
* variables:
* policy:
* fn::invoke:
* Function: gcp:compute:getRegionDiskIamPolicy
* Arguments:
* project: ${regiondisk.project}
* region: ${regiondisk.region}
* name: ${regiondisk.name}
* ```
*
* @param argument A collection of arguments for invoking getRegionDiskIamPolicy.
* @return A collection of values returned by getRegionDiskIamPolicy.
*/
public suspend fun getRegionDiskIamPolicy(argument: GetRegionDiskIamPolicyPlainArgs): GetRegionDiskIamPolicyResult =
getRegionDiskIamPolicyResultToKotlin(getRegionDiskIamPolicyPlain(argument.toJava()).await())
/**
* @see [getRegionDiskIamPolicy].
* @param name Used to find the parent resource to bind the IAM policy to
* @param project The ID of the project in which the resource belongs.
* If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
* @param region A reference to the region where the disk resides. Used to find the parent resource to bind the IAM policy to. If not specified,
* the value will be parsed from the identifier of the parent resource. If no region is provided in the parent identifier and no
* region is specified, it is taken from the provider configuration.
* @return A collection of values returned by getRegionDiskIamPolicy.
*/
public suspend fun getRegionDiskIamPolicy(
name: String,
project: String? = null,
region: String? = null,
): GetRegionDiskIamPolicyResult {
val argument = GetRegionDiskIamPolicyPlainArgs(
name = name,
project = project,
region = region,
)
return getRegionDiskIamPolicyResultToKotlin(getRegionDiskIamPolicyPlain(argument.toJava()).await())
}
/**
* @see [getRegionDiskIamPolicy].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetRegionDiskIamPolicyPlainArgs].
* @return A collection of values returned by getRegionDiskIamPolicy.
*/
public suspend fun getRegionDiskIamPolicy(argument: suspend GetRegionDiskIamPolicyPlainArgsBuilder.() -> Unit): GetRegionDiskIamPolicyResult {
val builder = GetRegionDiskIamPolicyPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getRegionDiskIamPolicyResultToKotlin(getRegionDiskIamPolicyPlain(builtArgument.toJava()).await())
}
/**
* Get a Compute Region Instance Group within GCE.
* For more information, see [the official documentation](https://cloud.google.com/compute/docs/instance-groups/distributing-instances-with-regional-instance-groups) and [API](https://cloud.google.com/compute/docs/reference/latest/regionInstanceGroups).
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const group = gcp.compute.getRegionInstanceGroup({
* name: "instance-group-name",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* group = gcp.compute.get_region_instance_group(name="instance-group-name")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var @group = Gcp.Compute.GetRegionInstanceGroup.Invoke(new()
* {
* Name = "instance-group-name",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.GetRegionInstanceGroup(ctx, &compute.GetRegionInstanceGroupArgs{
* Name: pulumi.StringRef("instance-group-name"),
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetRegionInstanceGroupArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var group = ComputeFunctions.getRegionInstanceGroup(GetRegionInstanceGroupArgs.builder()
* .name("instance-group-name")
* .build());
* }
* }
* ```
* ```yaml
* variables:
* group:
* fn::invoke:
* Function: gcp:compute:getRegionInstanceGroup
* Arguments:
* name: instance-group-name
* ```
*
* The most common use of this datasource will be to fetch information about the instances inside regional managed instance groups, for instance:
* @param argument A collection of arguments for invoking getRegionInstanceGroup.
* @return A collection of values returned by getRegionInstanceGroup.
*/
public suspend fun getRegionInstanceGroup(argument: GetRegionInstanceGroupPlainArgs): GetRegionInstanceGroupResult =
getRegionInstanceGroupResultToKotlin(getRegionInstanceGroupPlain(argument.toJava()).await())
/**
* @see [getRegionInstanceGroup].
* @param name The name of the instance group. One of `name` or `self_link` must be provided.
* @param project The ID of the project in which the resource belongs.
* If `self_link` is provided, this value is ignored. If neither `self_link`
* nor `project` are provided, the provider project is used.
* @param region The region in which the resource belongs. If `self_link`
* is provided, this value is ignored. If neither `self_link` nor `region` are
* provided, the provider region is used.
* @param selfLink The link to the instance group. One of `name` or `self_link` must be provided.
* - - -
* @return A collection of values returned by getRegionInstanceGroup.
*/
public suspend fun getRegionInstanceGroup(
name: String? = null,
project: String? = null,
region: String? = null,
selfLink: String? = null,
): GetRegionInstanceGroupResult {
val argument = GetRegionInstanceGroupPlainArgs(
name = name,
project = project,
region = region,
selfLink = selfLink,
)
return getRegionInstanceGroupResultToKotlin(getRegionInstanceGroupPlain(argument.toJava()).await())
}
/**
* @see [getRegionInstanceGroup].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetRegionInstanceGroupPlainArgs].
* @return A collection of values returned by getRegionInstanceGroup.
*/
public suspend fun getRegionInstanceGroup(argument: suspend GetRegionInstanceGroupPlainArgsBuilder.() -> Unit): GetRegionInstanceGroupResult {
val builder = GetRegionInstanceGroupPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getRegionInstanceGroupResultToKotlin(getRegionInstanceGroupPlain(builtArgument.toJava()).await())
}
/**
* Get information about a VM instance template resource within GCE. For more information see
* [the official documentation](https://cloud.google.com/compute/docs/instance-templates)
* and
* [API](https://cloud.google.com/compute/docs/reference/rest/v1/regionInstanceTemplates).
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* // by name
* const generic = gcp.compute.getRegionInstanceTemplate({
* name: "generic-tpl-20200107",
* });
* // using a filter
* const generic-regex = gcp.compute.getRegionInstanceTemplate({
* filter: "name != generic-tpl-20200107",
* mostRecent: true,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* # by name
* generic = gcp.compute.get_region_instance_template(name="generic-tpl-20200107")
* # using a filter
* generic_regex = gcp.compute.get_region_instance_template(filter="name != generic-tpl-20200107",
* most_recent=True)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* // by name
* var generic = Gcp.Compute.GetRegionInstanceTemplate.Invoke(new()
* {
* Name = "generic-tpl-20200107",
* });
* // using a filter
* var generic_regex = Gcp.Compute.GetRegionInstanceTemplate.Invoke(new()
* {
* Filter = "name != generic-tpl-20200107",
* MostRecent = true,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* // by name
* _, err := compute.LookupRegionInstanceTemplate(ctx, &compute.LookupRegionInstanceTemplateArgs{
* Name: pulumi.StringRef("generic-tpl-20200107"),
* }, nil)
* if err != nil {
* return err
* }
* // using a filter
* _, err = compute.LookupRegionInstanceTemplate(ctx, &compute.LookupRegionInstanceTemplateArgs{
* Filter: pulumi.StringRef("name != generic-tpl-20200107"),
* MostRecent: pulumi.BoolRef(true),
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetRegionInstanceTemplateArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* // by name
* final var generic = ComputeFunctions.getRegionInstanceTemplate(GetRegionInstanceTemplateArgs.builder()
* .name("generic-tpl-20200107")
* .build());
* // using a filter
* final var generic-regex = ComputeFunctions.getRegionInstanceTemplate(GetRegionInstanceTemplateArgs.builder()
* .filter("name != generic-tpl-20200107")
* .mostRecent(true)
* .build());
* }
* }
* ```
* ```yaml
* variables:
* # by name
* generic:
* fn::invoke:
* Function: gcp:compute:getRegionInstanceTemplate
* Arguments:
* name: generic-tpl-20200107
* # using a filter
* generic-regex:
* fn::invoke:
* Function: gcp:compute:getRegionInstanceTemplate
* Arguments:
* filter: name != generic-tpl-20200107
* mostRecent: true
* ```
*
* @param argument A collection of arguments for invoking getRegionInstanceTemplate.
* @return A collection of values returned by getRegionInstanceTemplate.
*/
public suspend fun getRegionInstanceTemplate(argument: GetRegionInstanceTemplatePlainArgs): GetRegionInstanceTemplateResult =
getRegionInstanceTemplateResultToKotlin(getRegionInstanceTemplatePlain(argument.toJava()).await())
/**
* @see [getRegionInstanceTemplate].
* @param filter A filter to retrieve the instance templates.
* See [gcloud topic filters](https://cloud.google.com/sdk/gcloud/reference/topic/filters) for reference.
* If multiple instance templates match, either adjust the filter or specify `most_recent`. One of `name` or `filter` must be provided.
* @param mostRecent If `filter` is provided, ensures the most recent template is returned when multiple instance templates match. One of `name` or `filter` must be provided.
* @param name The name of the instance template. One of `name` or `filter` must be provided.
* @param project The ID of the project in which the resource belongs.
* If `project` is not provided, the provider project is used.
* @param region The Region in which the resource belongs.
* If `region` is not provided, the provider region is used.
* @return A collection of values returned by getRegionInstanceTemplate.
*/
public suspend fun getRegionInstanceTemplate(
filter: String? = null,
mostRecent: Boolean? = null,
name: String? = null,
project: String? = null,
region: String? = null,
): GetRegionInstanceTemplateResult {
val argument = GetRegionInstanceTemplatePlainArgs(
filter = filter,
mostRecent = mostRecent,
name = name,
project = project,
region = region,
)
return getRegionInstanceTemplateResultToKotlin(getRegionInstanceTemplatePlain(argument.toJava()).await())
}
/**
* @see [getRegionInstanceTemplate].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetRegionInstanceTemplatePlainArgs].
* @return A collection of values returned by getRegionInstanceTemplate.
*/
public suspend fun getRegionInstanceTemplate(argument: suspend GetRegionInstanceTemplatePlainArgsBuilder.() -> Unit): GetRegionInstanceTemplateResult {
val builder = GetRegionInstanceTemplatePlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getRegionInstanceTemplateResultToKotlin(getRegionInstanceTemplatePlain(builtArgument.toJava()).await())
}
/**
* Use this data source to access a Region Network Endpoint Group's attributes.
* The RNEG may be found by providing either a `self_link`, or a `name` and a `region`.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const rneg1 = gcp.compute.getRegionNetworkEndpointGroup({
* name: "k8s1-abcdef01-myns-mysvc-8080-4b6bac43",
* region: "us-central1",
* });
* const rneg2 = gcp.compute.getRegionNetworkEndpointGroup({
* selfLink: "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/networkEndpointGroups/k8s1-abcdef01-myns-mysvc-8080-4b6bac43",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* rneg1 = gcp.compute.get_region_network_endpoint_group(name="k8s1-abcdef01-myns-mysvc-8080-4b6bac43",
* region="us-central1")
* rneg2 = gcp.compute.get_region_network_endpoint_group(self_link="https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/networkEndpointGroups/k8s1-abcdef01-myns-mysvc-8080-4b6bac43")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var rneg1 = Gcp.Compute.GetRegionNetworkEndpointGroup.Invoke(new()
* {
* Name = "k8s1-abcdef01-myns-mysvc-8080-4b6bac43",
* Region = "us-central1",
* });
* var rneg2 = Gcp.Compute.GetRegionNetworkEndpointGroup.Invoke(new()
* {
* SelfLink = "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/networkEndpointGroups/k8s1-abcdef01-myns-mysvc-8080-4b6bac43",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.LookupRegionNetworkEndpointGroup(ctx, &compute.LookupRegionNetworkEndpointGroupArgs{
* Name: pulumi.StringRef("k8s1-abcdef01-myns-mysvc-8080-4b6bac43"),
* Region: pulumi.StringRef("us-central1"),
* }, nil)
* if err != nil {
* return err
* }
* _, err = compute.LookupRegionNetworkEndpointGroup(ctx, &compute.LookupRegionNetworkEndpointGroupArgs{
* SelfLink: pulumi.StringRef("https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/networkEndpointGroups/k8s1-abcdef01-myns-mysvc-8080-4b6bac43"),
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetRegionNetworkEndpointGroupArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var rneg1 = ComputeFunctions.getRegionNetworkEndpointGroup(GetRegionNetworkEndpointGroupArgs.builder()
* .name("k8s1-abcdef01-myns-mysvc-8080-4b6bac43")
* .region("us-central1")
* .build());
* final var rneg2 = ComputeFunctions.getRegionNetworkEndpointGroup(GetRegionNetworkEndpointGroupArgs.builder()
* .selfLink("https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/networkEndpointGroups/k8s1-abcdef01-myns-mysvc-8080-4b6bac43")
* .build());
* }
* }
* ```
* ```yaml
* variables:
* rneg1:
* fn::invoke:
* Function: gcp:compute:getRegionNetworkEndpointGroup
* Arguments:
* name: k8s1-abcdef01-myns-mysvc-8080-4b6bac43
* region: us-central1
* rneg2:
* fn::invoke:
* Function: gcp:compute:getRegionNetworkEndpointGroup
* Arguments:
* selfLink: https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/networkEndpointGroups/k8s1-abcdef01-myns-mysvc-8080-4b6bac43
* ```
*
* @param argument A collection of arguments for invoking getRegionNetworkEndpointGroup.
* @return A collection of values returned by getRegionNetworkEndpointGroup.
*/
public suspend fun getRegionNetworkEndpointGroup(argument: GetRegionNetworkEndpointGroupPlainArgs): GetRegionNetworkEndpointGroupResult =
getRegionNetworkEndpointGroupResultToKotlin(getRegionNetworkEndpointGroupPlain(argument.toJava()).await())
/**
* @see [getRegionNetworkEndpointGroup].
* @param name The Network Endpoint Group name. Provide either this or a `self_link`.
* @param project The ID of the project to list versions in. If it is not provided, the provider project is used.
* @param region A reference to the region where the Serverless REGs Reside. Provide either this or a `self_link`.
* @param selfLink The Network Endpoint Group self_link.
* @return A collection of values returned by getRegionNetworkEndpointGroup.
*/
public suspend fun getRegionNetworkEndpointGroup(
name: String? = null,
project: String? = null,
region: String? = null,
selfLink: String? = null,
): GetRegionNetworkEndpointGroupResult {
val argument = GetRegionNetworkEndpointGroupPlainArgs(
name = name,
project = project,
region = region,
selfLink = selfLink,
)
return getRegionNetworkEndpointGroupResultToKotlin(getRegionNetworkEndpointGroupPlain(argument.toJava()).await())
}
/**
* @see [getRegionNetworkEndpointGroup].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetRegionNetworkEndpointGroupPlainArgs].
* @return A collection of values returned by getRegionNetworkEndpointGroup.
*/
public suspend fun getRegionNetworkEndpointGroup(argument: suspend GetRegionNetworkEndpointGroupPlainArgsBuilder.() -> Unit): GetRegionNetworkEndpointGroupResult {
val builder = GetRegionNetworkEndpointGroupPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getRegionNetworkEndpointGroupResultToKotlin(getRegionNetworkEndpointGroupPlain(builtArgument.toJava()).await())
}
/**
* Get info about a Region Google Compute SSL Certificate from its name.
* ## Example Usage
* ```tf
* data "google_compute_region_ssl_certificate" "my_cert" {
* name = "my-cert"
* }
* output "certificate" {
* value = data.google_compute_region_ssl_certificate.my_cert.certificate
* }
* output "certificate_id" {
* value = data.google_compute_region_ssl_certificate.my_cert.certificate_id
* }
* output "self_link" {
* value = data.google_compute_region_ssl_certificate.my_cert.self_link
* }
* ```
* @param argument A collection of arguments for invoking getRegionSslCertificate.
* @return A collection of values returned by getRegionSslCertificate.
*/
public suspend fun getRegionSslCertificate(argument: GetRegionSslCertificatePlainArgs): GetRegionSslCertificateResult =
getRegionSslCertificateResultToKotlin(getRegionSslCertificatePlain(argument.toJava()).await())
/**
* @see [getRegionSslCertificate].
* @param name The name of the certificate.
* - - -
* @param project The project in which the resource belongs. If it
* is not provided, the provider project is used.
* @param region The region in which the resource belongs. If it
* is not provided, the provider region is used.
* @return A collection of values returned by getRegionSslCertificate.
*/
public suspend fun getRegionSslCertificate(
name: String,
project: String? = null,
region: String? = null,
): GetRegionSslCertificateResult {
val argument = GetRegionSslCertificatePlainArgs(
name = name,
project = project,
region = region,
)
return getRegionSslCertificateResultToKotlin(getRegionSslCertificatePlain(argument.toJava()).await())
}
/**
* @see [getRegionSslCertificate].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetRegionSslCertificatePlainArgs].
* @return A collection of values returned by getRegionSslCertificate.
*/
public suspend fun getRegionSslCertificate(argument: suspend GetRegionSslCertificatePlainArgsBuilder.() -> Unit): GetRegionSslCertificateResult {
val builder = GetRegionSslCertificatePlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getRegionSslCertificateResultToKotlin(getRegionSslCertificatePlain(builtArgument.toJava()).await())
}
/**
* Provides access to available Google Compute regions for a given project.
* See more about [regions and zones](https://cloud.google.com/compute/docs/regions-zones/) in the upstream docs.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* export = async () => {
* const available = await gcp.compute.getRegions({});
* const cluster: gcp.compute.Subnetwork[] = [];
* for (const range = {value: 0}; range.value < available.names.length; range.value++) {
* cluster.push(new gcp.compute.Subnetwork(`cluster-${range.value}`, {
* name: "my-network",
* ipCidrRange: `10.36.${range.value}.0/24`,
* network: "my-network",
* region: available.names[range.value],
* }));
* }
* }
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* available = gcp.compute.get_regions()
* cluster = []
* for range in [{"value": i} for i in range(0, len(available.names))]:
* cluster.append(gcp.compute.Subnetwork(f"cluster-{range['value']}",
* name="my-network",
* ip_cidr_range=f"10.36.{range['value']}.0/24",
* network="my-network",
* region=available.names[range["value"]]))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using System.Threading.Tasks;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(async() =>
* {
* var available = await Gcp.Compute.GetRegions.InvokeAsync();
* var cluster = new List();
* for (var rangeIndex = 0; rangeIndex < available.Names.Length; rangeIndex++)
* {
* var range = new { Value = rangeIndex };
* cluster.Add(new Gcp.Compute.Subnetwork($"cluster-{range.Value}", new()
* {
* Name = "my-network",
* IpCidrRange = $"10.36.{range.Value}.0/24",
* Network = "my-network",
* Region = available.Names[range.Value],
* }));
* }
* });
* ```
* ```go
* package main
* import (
* "fmt"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* available, err := compute.GetRegions(ctx, nil, nil)
* if err != nil {
* return err
* }
* var cluster []*compute.Subnetwork
* for index := 0; index < len(available.Names); index++ {
* key0 := index
* val0 := index
* __res, err := compute.NewSubnetwork(ctx, fmt.Sprintf("cluster-%v", key0), &compute.SubnetworkArgs{
* Name: pulumi.String("my-network"),
* IpCidrRange: pulumi.String(fmt.Sprintf("10.36.%v.0/24", val0)),
* Network: pulumi.String("my-network"),
* Region: available.Names[val0],
* })
* if err != nil {
* return err
* }
* cluster = append(cluster, __res)
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetRegionsArgs;
* import com.pulumi.gcp.compute.Subnetwork;
* import com.pulumi.gcp.compute.SubnetworkArgs;
* import com.pulumi.codegen.internal.KeyedValue;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var available = ComputeFunctions.getRegions();
* for (var i = 0; i < available.applyValue(getRegionsResult -> getRegionsResult.names()).length(); i++) {
* new Subnetwork("cluster-" + i, SubnetworkArgs.builder()
* .name("my-network")
* .ipCidrRange(String.format("10.36.%s.0/24", range.value()))
* .network("my-network")
* .region(available.applyValue(getRegionsResult -> getRegionsResult.names())[range.value()])
* .build());
* }
* }
* }
* ```
*
* @param argument A collection of arguments for invoking getRegions.
* @return A collection of values returned by getRegions.
*/
public suspend fun getRegions(argument: GetRegionsPlainArgs): GetRegionsResult =
getRegionsResultToKotlin(getRegionsPlain(argument.toJava()).await())
/**
* @see [getRegions].
* @param project Project from which to list available regions. Defaults to project declared in the provider.
* @param status Allows to filter list of regions based on their current status. Status can be either `UP` or `DOWN`.
* Defaults to no filtering (all available regions - both `UP` and `DOWN`).
* @return A collection of values returned by getRegions.
*/
public suspend fun getRegions(project: String? = null, status: String? = null): GetRegionsResult {
val argument = GetRegionsPlainArgs(
project = project,
status = status,
)
return getRegionsResultToKotlin(getRegionsPlain(argument.toJava()).await())
}
/**
* @see [getRegions].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetRegionsPlainArgs].
* @return A collection of values returned by getRegions.
*/
public suspend fun getRegions(argument: suspend GetRegionsPlainArgsBuilder.() -> Unit): GetRegionsResult {
val builder = GetRegionsPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getRegionsResultToKotlin(getRegionsPlain(builtArgument.toJava()).await())
}
/**
* Provides access to available Google Compute Reservation Resources for a given project.
* See more about [Reservations of Compute Engine resources](https://cloud.google.com/compute/docs/instances/reservations-overview) in the upstream docs.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const reservation = gcp.compute.getReservation({
* name: "gce-reservation",
* zone: "us-central1-a",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* reservation = gcp.compute.get_reservation(name="gce-reservation",
* zone="us-central1-a")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var reservation = Gcp.Compute.GetReservation.Invoke(new()
* {
* Name = "gce-reservation",
* Zone = "us-central1-a",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.LookupReservation(ctx, &compute.LookupReservationArgs{
* Name: "gce-reservation",
* Zone: "us-central1-a",
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetReservationArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var reservation = ComputeFunctions.getReservation(GetReservationArgs.builder()
* .name("gce-reservation")
* .zone("us-central1-a")
* .build());
* }
* }
* ```
* ```yaml
* variables:
* reservation:
* fn::invoke:
* Function: gcp:compute:getReservation
* Arguments:
* name: gce-reservation
* zone: us-central1-a
* ```
*
* @param argument A collection of arguments for invoking getReservation.
* @return A collection of values returned by getReservation.
*/
public suspend fun getReservation(argument: GetReservationPlainArgs): GetReservationResult =
getReservationResultToKotlin(getReservationPlain(argument.toJava()).await())
/**
* @see [getReservation].
* @param name The name of the Compute Reservation.
* @param project Project from which to list the Compute Reservation. Defaults to project declared in the provider.
* @param zone Zone where the Compute Reservation resides.
* @return A collection of values returned by getReservation.
*/
public suspend fun getReservation(
name: String,
project: String? = null,
zone: String,
): GetReservationResult {
val argument = GetReservationPlainArgs(
name = name,
project = project,
zone = zone,
)
return getReservationResultToKotlin(getReservationPlain(argument.toJava()).await())
}
/**
* @see [getReservation].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetReservationPlainArgs].
* @return A collection of values returned by getReservation.
*/
public suspend fun getReservation(argument: suspend GetReservationPlainArgsBuilder.() -> Unit): GetReservationResult {
val builder = GetReservationPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getReservationResultToKotlin(getReservationPlain(builtArgument.toJava()).await())
}
/**
* Provide access to a Resource Policy's attributes. For more information see [the official documentation](https://cloud.google.com/compute/docs/disks/scheduled-snapshots) or the [API](https://cloud.google.com/compute/docs/reference/rest/beta/resourcePolicies).
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const daily = gcp.compute.getResourcePolicy({
* name: "daily",
* region: "us-central1",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* daily = gcp.compute.get_resource_policy(name="daily",
* region="us-central1")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var daily = Gcp.Compute.GetResourcePolicy.Invoke(new()
* {
* Name = "daily",
* Region = "us-central1",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.LookupResourcePolicy(ctx, &compute.LookupResourcePolicyArgs{
* Name: "daily",
* Region: pulumi.StringRef("us-central1"),
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetResourcePolicyArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var daily = ComputeFunctions.getResourcePolicy(GetResourcePolicyArgs.builder()
* .name("daily")
* .region("us-central1")
* .build());
* }
* }
* ```
* ```yaml
* variables:
* daily:
* fn::invoke:
* Function: gcp:compute:getResourcePolicy
* Arguments:
* name: daily
* region: us-central1
* ```
*
* @param argument A collection of arguments for invoking getResourcePolicy.
* @return A collection of values returned by getResourcePolicy.
*/
public suspend fun getResourcePolicy(argument: GetResourcePolicyPlainArgs): GetResourcePolicyResult =
getResourcePolicyResultToKotlin(getResourcePolicyPlain(argument.toJava()).await())
/**
* @see [getResourcePolicy].
* @param name The name of the Resource Policy.
* @param project Project from which to list the Resource Policy. Defaults to project declared in the provider.
* @param region Region where the Resource Policy resides.
* @return A collection of values returned by getResourcePolicy.
*/
public suspend fun getResourcePolicy(
name: String,
project: String? = null,
region: String? = null,
): GetResourcePolicyResult {
val argument = GetResourcePolicyPlainArgs(
name = name,
project = project,
region = region,
)
return getResourcePolicyResultToKotlin(getResourcePolicyPlain(argument.toJava()).await())
}
/**
* @see [getResourcePolicy].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetResourcePolicyPlainArgs].
* @return A collection of values returned by getResourcePolicy.
*/
public suspend fun getResourcePolicy(argument: suspend GetResourcePolicyPlainArgsBuilder.() -> Unit): GetResourcePolicyResult {
val builder = GetResourcePolicyPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getResourcePolicyResultToKotlin(getResourcePolicyPlain(builtArgument.toJava()).await())
}
/**
* Get a router within GCE from its name and VPC.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const my-router = gcp.compute.getRouter({
* name: "myrouter-us-east1",
* network: "my-network",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* my_router = gcp.compute.get_router(name="myrouter-us-east1",
* network="my-network")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var my_router = Gcp.Compute.GetRouter.Invoke(new()
* {
* Name = "myrouter-us-east1",
* Network = "my-network",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.LookupRouter(ctx, &compute.LookupRouterArgs{
* Name: "myrouter-us-east1",
* Network: "my-network",
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetRouterArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var my-router = ComputeFunctions.getRouter(GetRouterArgs.builder()
* .name("myrouter-us-east1")
* .network("my-network")
* .build());
* }
* }
* ```
* ```yaml
* variables:
* my-router:
* fn::invoke:
* Function: gcp:compute:getRouter
* Arguments:
* name: myrouter-us-east1
* network: my-network
* ```
*
* @param argument A collection of arguments for invoking getRouter.
* @return A collection of values returned by getRouter.
*/
public suspend fun getRouter(argument: GetRouterPlainArgs): GetRouterResult =
getRouterResultToKotlin(getRouterPlain(argument.toJava()).await())
/**
* @see [getRouter].
* @param name The name of the router.
* @param network The VPC network on which this router lives.
* @param project The ID of the project in which the resource
* belongs. If it is not provided, the provider project is used.
* @param region The region this router has been created in. If
* unspecified, this defaults to the region configured in the provider.
* @return A collection of values returned by getRouter.
*/
public suspend fun getRouter(
name: String,
network: String,
project: String? = null,
region: String? = null,
): GetRouterResult {
val argument = GetRouterPlainArgs(
name = name,
network = network,
project = project,
region = region,
)
return getRouterResultToKotlin(getRouterPlain(argument.toJava()).await())
}
/**
* @see [getRouter].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetRouterPlainArgs].
* @return A collection of values returned by getRouter.
*/
public suspend fun getRouter(argument: suspend GetRouterPlainArgsBuilder.() -> Unit): GetRouterResult {
val builder = GetRouterPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getRouterResultToKotlin(getRouterPlain(builtArgument.toJava()).await())
}
/**
* To get more information about Snapshot, see:
* * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/routers)
* * How-to Guides
* * [Official Documentation](https://cloud.google.com/router/docs/)
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const foo = gcp.compute.getRouterNat({
* name: "my-nat",
* router: "my-router",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* foo = gcp.compute.get_router_nat(name="my-nat",
* router="my-router")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var foo = Gcp.Compute.GetRouterNat.Invoke(new()
* {
* Name = "my-nat",
* Router = "my-router",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.LookupRouterNat(ctx, &compute.LookupRouterNatArgs{
* Name: "my-nat",
* Router: "my-router",
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetRouterNatArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var foo = ComputeFunctions.getRouterNat(GetRouterNatArgs.builder()
* .name("my-nat")
* .router("my-router")
* .build());
* }
* }
* ```
* ```yaml
* variables:
* foo:
* fn::invoke:
* Function: gcp:compute:getRouterNat
* Arguments:
* name: my-nat
* router: my-router
* ```
*
* @param argument A collection of arguments for invoking getRouterNat.
* @return A collection of values returned by getRouterNat.
*/
public suspend fun getRouterNat(argument: GetRouterNatPlainArgs): GetRouterNatResult =
getRouterNatResultToKotlin(getRouterNatPlain(argument.toJava()).await())
/**
* @see [getRouterNat].
* @param name Name of the NAT service. The name must be 1-63 characters long and
* comply with RFC1035.
* @param project The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
* @param region Region where the router and NAT reside.
* @param router The name of the Cloud Router in which this NAT will be configured.
* - - -
* @return A collection of values returned by getRouterNat.
*/
public suspend fun getRouterNat(
name: String,
project: String? = null,
region: String? = null,
router: String,
): GetRouterNatResult {
val argument = GetRouterNatPlainArgs(
name = name,
project = project,
region = region,
router = router,
)
return getRouterNatResultToKotlin(getRouterNatPlain(argument.toJava()).await())
}
/**
* @see [getRouterNat].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetRouterNatPlainArgs].
* @return A collection of values returned by getRouterNat.
*/
public suspend fun getRouterNat(argument: suspend GetRouterNatPlainArgsBuilder.() -> Unit): GetRouterNatResult {
val builder = GetRouterNatPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getRouterNatResultToKotlin(getRouterNatPlain(builtArgument.toJava()).await())
}
/**
* Get a Cloud Router's status within GCE from its name and region. This data source exposes the
* routes learned by a Cloud Router via BGP peers.
* For more information see [the official documentation](https://cloud.google.com/network-connectivity/docs/router/how-to/viewing-router-details)
* and
* [API](https://cloud.google.com/compute/docs/reference/rest/v1/routers/getRouterStatus).
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const my-router = gcp.compute.getRouterStatus({
* name: "myrouter",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* my_router = gcp.compute.get_router_status(name="myrouter")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var my_router = Gcp.Compute.GetRouterStatus.Invoke(new()
* {
* Name = "myrouter",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.GetRouterStatus(ctx, &compute.GetRouterStatusArgs{
* Name: "myrouter",
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetRouterStatusArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var my-router = ComputeFunctions.getRouterStatus(GetRouterStatusArgs.builder()
* .name("myrouter")
* .build());
* }
* }
* ```
* ```yaml
* variables:
* my-router:
* fn::invoke:
* Function: gcp:compute:getRouterStatus
* Arguments:
* name: myrouter
* ```
*
* @param argument A collection of arguments for invoking getRouterStatus.
* @return A collection of values returned by getRouterStatus.
*/
public suspend fun getRouterStatus(argument: GetRouterStatusPlainArgs): GetRouterStatusResult =
getRouterStatusResultToKotlin(getRouterStatusPlain(argument.toJava()).await())
/**
* @see [getRouterStatus].
* @param name The name of the router.
* @param project The ID of the project in which the resource
* belongs. If it is not provided, the provider project is used.
* @param region The region this router has been created in. If
* unspecified, this defaults to the region configured in the provider.
* @return A collection of values returned by getRouterStatus.
*/
public suspend fun getRouterStatus(
name: String,
project: String? = null,
region: String? = null,
): GetRouterStatusResult {
val argument = GetRouterStatusPlainArgs(
name = name,
project = project,
region = region,
)
return getRouterStatusResultToKotlin(getRouterStatusPlain(argument.toJava()).await())
}
/**
* @see [getRouterStatus].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetRouterStatusPlainArgs].
* @return A collection of values returned by getRouterStatus.
*/
public suspend fun getRouterStatus(argument: suspend GetRouterStatusPlainArgsBuilder.() -> Unit): GetRouterStatusResult {
val builder = GetRouterStatusPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getRouterStatusResultToKotlin(getRouterStatusPlain(builtArgument.toJava()).await())
}
/**
* Gets an SSL Policy within GCE from its name, for use with Target HTTPS and Target SSL Proxies.
* For more information see [the official documentation](https://cloud.google.com/compute/docs/load-balancing/ssl-policies).
* ## Example Usage
* ```tf
* data "google_compute_ssl_policy" "my-ssl-policy" {
* name = "production-ssl-policy"
* }
* ```
* @param argument A collection of arguments for invoking getSSLPolicy.
* @return A collection of values returned by getSSLPolicy.
*/
public suspend fun getSSLPolicy(argument: GetSSLPolicyPlainArgs): GetSSLPolicyResult =
getSSLPolicyResultToKotlin(getSSLPolicyPlain(argument.toJava()).await())
/**
* @see [getSSLPolicy].
* @param name The name of the SSL Policy.
* - - -
* @param project The ID of the project in which the resource belongs. If it
* is not provided, the provider project is used.
* @return A collection of values returned by getSSLPolicy.
*/
public suspend fun getSSLPolicy(name: String, project: String? = null): GetSSLPolicyResult {
val argument = GetSSLPolicyPlainArgs(
name = name,
project = project,
)
return getSSLPolicyResultToKotlin(getSSLPolicyPlain(argument.toJava()).await())
}
/**
* @see [getSSLPolicy].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetSSLPolicyPlainArgs].
* @return A collection of values returned by getSSLPolicy.
*/
public suspend fun getSSLPolicy(argument: suspend GetSSLPolicyPlainArgsBuilder.() -> Unit): GetSSLPolicyResult {
val builder = GetSSLPolicyPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getSSLPolicyResultToKotlin(getSSLPolicyPlain(builtArgument.toJava()).await())
}
/**
* To get more information about Snapshot, see:
* * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/snapshots)
* * How-to Guides
* * [Official Documentation](https://cloud.google.com/compute/docs/disks/create-snapshots)
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* //by name
* const snapshot = gcp.compute.getSnapshot({
* name: "my-snapshot",
* });
* // using a filter
* const latest-snapshot = gcp.compute.getSnapshot({
* filter: "name != my-snapshot",
* mostRecent: true,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* #by name
* snapshot = gcp.compute.get_snapshot(name="my-snapshot")
* # using a filter
* latest_snapshot = gcp.compute.get_snapshot(filter="name != my-snapshot",
* most_recent=True)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* //by name
* var snapshot = Gcp.Compute.GetSnapshot.Invoke(new()
* {
* Name = "my-snapshot",
* });
* // using a filter
* var latest_snapshot = Gcp.Compute.GetSnapshot.Invoke(new()
* {
* Filter = "name != my-snapshot",
* MostRecent = true,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* // by name
* _, err := compute.LookupSnapshot(ctx, &compute.LookupSnapshotArgs{
* Name: pulumi.StringRef("my-snapshot"),
* }, nil)
* if err != nil {
* return err
* }
* // using a filter
* _, err = compute.LookupSnapshot(ctx, &compute.LookupSnapshotArgs{
* Filter: pulumi.StringRef("name != my-snapshot"),
* MostRecent: pulumi.BoolRef(true),
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetSnapshotArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* //by name
* final var snapshot = ComputeFunctions.getSnapshot(GetSnapshotArgs.builder()
* .name("my-snapshot")
* .build());
* // using a filter
* final var latest-snapshot = ComputeFunctions.getSnapshot(GetSnapshotArgs.builder()
* .filter("name != my-snapshot")
* .mostRecent(true)
* .build());
* }
* }
* ```
* ```yaml
* variables:
* #by name
* snapshot:
* fn::invoke:
* Function: gcp:compute:getSnapshot
* Arguments:
* name: my-snapshot
* # using a filter
* latest-snapshot:
* fn::invoke:
* Function: gcp:compute:getSnapshot
* Arguments:
* filter: name != my-snapshot
* mostRecent: true
* ```
*
* @param argument A collection of arguments for invoking getSnapshot.
* @return A collection of values returned by getSnapshot.
*/
public suspend fun getSnapshot(argument: GetSnapshotPlainArgs): GetSnapshotResult =
getSnapshotResultToKotlin(getSnapshotPlain(argument.toJava()).await())
/**
* /*
* @see [getSnapshot].
* @param filter A filter to retrieve the compute snapshot.
* See [gcloud topic filters](https://cloud.google.com/sdk/gcloud/reference/topic/filters) for reference.
* If multiple compute snapshot match, either adjust the filter or specify `most_recent`. One of `name` or `filter` must be provided.
* If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Example `sourceDisk eq '.*(.*/data-disk$).*'`. More details for golang Snapshots list call filters [here](https://pkg.go.dev/google.golang.org/api/compute/v1#SnapshotsListCall.Filter).
* @param mostRecent If `filter` is provided, ensures the most recent snapshot is returned when multiple compute snapshot match.
* - - -
* @param name The name of the compute snapshot. One of `name` or `filter` must be provided.
* @param project The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
* @return A collection of values returned by getSnapshot.
*/
public suspend fun getSnapshot(
filter: String? = null,
mostRecent: Boolean? = null,
name: String? = null,
project: String? = null,
): GetSnapshotResult {
val argument = GetSnapshotPlainArgs(
filter = filter,
mostRecent = mostRecent,
name = name,
project = project,
)
return getSnapshotResultToKotlin(getSnapshotPlain(argument.toJava()).await())
}
/**
* @see [getSnapshot].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetSnapshotPlainArgs].
* @return A collection of values returned by getSnapshot.
*/
public suspend fun getSnapshot(argument: suspend GetSnapshotPlainArgsBuilder.() -> Unit): GetSnapshotResult {
val builder = GetSnapshotPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getSnapshotResultToKotlin(getSnapshotPlain(builtArgument.toJava()).await())
}
/**
* Retrieves the current IAM policy data for snapshot
* ## example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const policy = gcp.compute.getSnapshotIamPolicy({
* project: snapshot.project,
* name: snapshot.name,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* policy = gcp.compute.get_snapshot_iam_policy(project=snapshot["project"],
* name=snapshot["name"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var policy = Gcp.Compute.GetSnapshotIamPolicy.Invoke(new()
* {
* Project = snapshot.Project,
* Name = snapshot.Name,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.LookupSnapshotIamPolicy(ctx, &compute.LookupSnapshotIamPolicyArgs{
* Project: pulumi.StringRef(snapshot.Project),
* Name: snapshot.Name,
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetSnapshotIamPolicyArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var policy = ComputeFunctions.getSnapshotIamPolicy(GetSnapshotIamPolicyArgs.builder()
* .project(snapshot.project())
* .name(snapshot.name())
* .build());
* }
* }
* ```
* ```yaml
* variables:
* policy:
* fn::invoke:
* Function: gcp:compute:getSnapshotIamPolicy
* Arguments:
* project: ${snapshot.project}
* name: ${snapshot.name}
* ```
*
* @param argument A collection of arguments for invoking getSnapshotIamPolicy.
* @return A collection of values returned by getSnapshotIamPolicy.
*/
public suspend fun getSnapshotIamPolicy(argument: GetSnapshotIamPolicyPlainArgs): GetSnapshotIamPolicyResult =
getSnapshotIamPolicyResultToKotlin(getSnapshotIamPolicyPlain(argument.toJava()).await())
/**
* @see [getSnapshotIamPolicy].
* @param name Used to find the parent resource to bind the IAM policy to
* @param project The ID of the project in which the resource belongs.
* If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
* @return A collection of values returned by getSnapshotIamPolicy.
*/
public suspend fun getSnapshotIamPolicy(name: String, project: String? = null): GetSnapshotIamPolicyResult {
val argument = GetSnapshotIamPolicyPlainArgs(
name = name,
project = project,
)
return getSnapshotIamPolicyResultToKotlin(getSnapshotIamPolicyPlain(argument.toJava()).await())
}
/**
* @see [getSnapshotIamPolicy].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetSnapshotIamPolicyPlainArgs].
* @return A collection of values returned by getSnapshotIamPolicy.
*/
public suspend fun getSnapshotIamPolicy(argument: suspend GetSnapshotIamPolicyPlainArgsBuilder.() -> Unit): GetSnapshotIamPolicyResult {
val builder = GetSnapshotIamPolicyPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getSnapshotIamPolicyResultToKotlin(getSnapshotIamPolicyPlain(builtArgument.toJava()).await())
}
/**
* Get a subnetwork within GCE from its name and region.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const my-subnetwork = gcp.compute.getSubnetwork({
* name: "default-us-east1",
* region: "us-east1",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* my_subnetwork = gcp.compute.get_subnetwork(name="default-us-east1",
* region="us-east1")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var my_subnetwork = Gcp.Compute.GetSubnetwork.Invoke(new()
* {
* Name = "default-us-east1",
* Region = "us-east1",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.LookupSubnetwork(ctx, &compute.LookupSubnetworkArgs{
* Name: pulumi.StringRef("default-us-east1"),
* Region: pulumi.StringRef("us-east1"),
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetSubnetworkArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var my-subnetwork = ComputeFunctions.getSubnetwork(GetSubnetworkArgs.builder()
* .name("default-us-east1")
* .region("us-east1")
* .build());
* }
* }
* ```
* ```yaml
* variables:
* my-subnetwork:
* fn::invoke:
* Function: gcp:compute:getSubnetwork
* Arguments:
* name: default-us-east1
* region: us-east1
* ```
*
* @param argument A collection of arguments for invoking getSubnetwork.
* @return A collection of values returned by getSubnetwork.
*/
public suspend fun getSubnetwork(argument: GetSubnetworkPlainArgs): GetSubnetworkResult =
getSubnetworkResultToKotlin(getSubnetworkPlain(argument.toJava()).await())
/**
* @see [getSubnetwork].
* @param name The name of the subnetwork. One of `name` or `self_link`
* must be specified.
* @param project The ID of the project in which the resource belongs. If it
* is not provided, the provider project is used.
* @param region The region this subnetwork has been created in. If
* unspecified, this defaults to the region configured in the provider.
* @param selfLink The self link of the subnetwork. If `self_link` is
* specified, `name`, `project`, and `region` are ignored.
* @return A collection of values returned by getSubnetwork.
*/
public suspend fun getSubnetwork(
name: String? = null,
project: String? = null,
region: String? = null,
selfLink: String? = null,
): GetSubnetworkResult {
val argument = GetSubnetworkPlainArgs(
name = name,
project = project,
region = region,
selfLink = selfLink,
)
return getSubnetworkResultToKotlin(getSubnetworkPlain(argument.toJava()).await())
}
/**
* @see [getSubnetwork].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetSubnetworkPlainArgs].
* @return A collection of values returned by getSubnetwork.
*/
public suspend fun getSubnetwork(argument: suspend GetSubnetworkPlainArgsBuilder.() -> Unit): GetSubnetworkResult {
val builder = GetSubnetworkPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getSubnetworkResultToKotlin(getSubnetworkPlain(builtArgument.toJava()).await())
}
/**
* Retrieves the current IAM policy data for subnetwork
* ## example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const policy = gcp.compute.getSubnetworkIamPolicy({
* project: network_with_private_secondary_ip_ranges.project,
* region: network_with_private_secondary_ip_ranges.region,
* subnetwork: network_with_private_secondary_ip_ranges.name,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* policy = gcp.compute.get_subnetwork_iam_policy(project=network_with_private_secondary_ip_ranges["project"],
* region=network_with_private_secondary_ip_ranges["region"],
* subnetwork=network_with_private_secondary_ip_ranges["name"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var policy = Gcp.Compute.GetSubnetworkIamPolicy.Invoke(new()
* {
* Project = network_with_private_secondary_ip_ranges.Project,
* Region = network_with_private_secondary_ip_ranges.Region,
* Subnetwork = network_with_private_secondary_ip_ranges.Name,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.GetSubnetworkIamPolicy(ctx, &compute.GetSubnetworkIamPolicyArgs{
* Project: pulumi.StringRef(network_with_private_secondary_ip_ranges.Project),
* Region: pulumi.StringRef(network_with_private_secondary_ip_ranges.Region),
* Subnetwork: network_with_private_secondary_ip_ranges.Name,
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetSubnetworkIamPolicyArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var policy = ComputeFunctions.getSubnetworkIamPolicy(GetSubnetworkIamPolicyArgs.builder()
* .project(network_with_private_secondary_ip_ranges.project())
* .region(network_with_private_secondary_ip_ranges.region())
* .subnetwork(network_with_private_secondary_ip_ranges.name())
* .build());
* }
* }
* ```
* ```yaml
* variables:
* policy:
* fn::invoke:
* Function: gcp:compute:getSubnetworkIamPolicy
* Arguments:
* project: ${["network-with-private-secondary-ip-ranges"].project}
* region: ${["network-with-private-secondary-ip-ranges"].region}
* subnetwork: ${["network-with-private-secondary-ip-ranges"].name}
* ```
*
* @param argument A collection of arguments for invoking getSubnetworkIamPolicy.
* @return A collection of values returned by getSubnetworkIamPolicy.
*/
public suspend fun getSubnetworkIamPolicy(argument: GetSubnetworkIamPolicyPlainArgs): GetSubnetworkIamPolicyResult =
getSubnetworkIamPolicyResultToKotlin(getSubnetworkIamPolicyPlain(argument.toJava()).await())
/**
* @see [getSubnetworkIamPolicy].
* @param project The ID of the project in which the resource belongs.
* If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
* @param region The GCP region for this subnetwork.
* Used to find the parent resource to bind the IAM policy to. If not specified,
* the value will be parsed from the identifier of the parent resource. If no region is provided in the parent identifier and no
* region is specified, it is taken from the provider configuration.
* @param subnetwork Used to find the parent resource to bind the IAM policy to
* @return A collection of values returned by getSubnetworkIamPolicy.
*/
public suspend fun getSubnetworkIamPolicy(
project: String? = null,
region: String? = null,
subnetwork: String,
): GetSubnetworkIamPolicyResult {
val argument = GetSubnetworkIamPolicyPlainArgs(
project = project,
region = region,
subnetwork = subnetwork,
)
return getSubnetworkIamPolicyResultToKotlin(getSubnetworkIamPolicyPlain(argument.toJava()).await())
}
/**
* @see [getSubnetworkIamPolicy].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetSubnetworkIamPolicyPlainArgs].
* @return A collection of values returned by getSubnetworkIamPolicy.
*/
public suspend fun getSubnetworkIamPolicy(argument: suspend GetSubnetworkIamPolicyPlainArgsBuilder.() -> Unit): GetSubnetworkIamPolicyResult {
val builder = GetSubnetworkIamPolicyPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getSubnetworkIamPolicyResultToKotlin(getSubnetworkIamPolicyPlain(builtArgument.toJava()).await())
}
/**
* Get a VPN gateway within GCE from its name.
* ## Example Usage
* ```tf
* data "google_compute_vpn_gateway" "my-vpn-gateway" {
* name = "vpn-gateway-us-east1"
* }
* ```
* @param argument A collection of arguments for invoking getVPNGateway.
* @return A collection of values returned by getVPNGateway.
*/
public suspend fun getVPNGateway(argument: GetVPNGatewayPlainArgs): GetVPNGatewayResult =
getVPNGatewayResultToKotlin(getVPNGatewayPlain(argument.toJava()).await())
/**
* @see [getVPNGateway].
* @param name The name of the VPN gateway.
* - - -
* @param project The project in which the resource belongs. If it
* is not provided, the provider project is used.
* @param region The region in which the resource belongs. If it
* is not provided, the project region is used.
* @return A collection of values returned by getVPNGateway.
*/
public suspend fun getVPNGateway(
name: String,
project: String? = null,
region: String? = null,
): GetVPNGatewayResult {
val argument = GetVPNGatewayPlainArgs(
name = name,
project = project,
region = region,
)
return getVPNGatewayResultToKotlin(getVPNGatewayPlain(argument.toJava()).await())
}
/**
* @see [getVPNGateway].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetVPNGatewayPlainArgs].
* @return A collection of values returned by getVPNGateway.
*/
public suspend fun getVPNGateway(argument: suspend GetVPNGatewayPlainArgsBuilder.() -> Unit): GetVPNGatewayResult {
val builder = GetVPNGatewayPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getVPNGatewayResultToKotlin(getVPNGatewayPlain(builtArgument.toJava()).await())
}
/**
* Provides access to available Google Compute zones in a region for a given project.
* See more about [regions and zones](https://cloud.google.com/compute/docs/regions-zones/regions-zones) in the upstream docs.
* @param argument A collection of arguments for invoking getZones.
* @return A collection of values returned by getZones.
*/
public suspend fun getZones(argument: GetZonesPlainArgs): GetZonesResult =
getZonesResultToKotlin(getZonesPlain(argument.toJava()).await())
/**
* @see [getZones].
* @param project Project from which to list available zones. Defaults to project declared in the provider.
* @param region Region from which to list available zones. Defaults to region declared in the provider.
* @param status Allows to filter list of zones based on their current status. Status can be either `UP` or `DOWN`.
* Defaults to no filtering (all available zones - both `UP` and `DOWN`).
* @return A collection of values returned by getZones.
*/
public suspend fun getZones(
project: String? = null,
region: String? = null,
status: String? = null,
): GetZonesResult {
val argument = GetZonesPlainArgs(
project = project,
region = region,
status = status,
)
return getZonesResultToKotlin(getZonesPlain(argument.toJava()).await())
}
/**
* @see [getZones].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.GetZonesPlainArgs].
* @return A collection of values returned by getZones.
*/
public suspend fun getZones(argument: suspend GetZonesPlainArgsBuilder.() -> Unit): GetZonesResult {
val builder = GetZonesPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getZonesResultToKotlin(getZonesPlain(builtArgument.toJava()).await())
}
/**
* Get a Cloud Router's status within GCE from its name and region. This data source exposes the
* routes learned by a Cloud Router via BGP peers.
* For more information see [the official documentation](https://cloud.google.com/network-connectivity/docs/router/how-to/viewing-router-details)
* and
* [API](https://cloud.google.com/compute/docs/reference/rest/v1/routers/getRouterStatus).
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const my-router = gcp.compute.getRouterStatus({
* name: "myrouter",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* my_router = gcp.compute.get_router_status(name="myrouter")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var my_router = Gcp.Compute.GetRouterStatus.Invoke(new()
* {
* Name = "myrouter",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.GetRouterStatus(ctx, &compute.GetRouterStatusArgs{
* Name: "myrouter",
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetRouterStatusArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var my-router = ComputeFunctions.getRouterStatus(GetRouterStatusArgs.builder()
* .name("myrouter")
* .build());
* }
* }
* ```
* ```yaml
* variables:
* my-router:
* fn::invoke:
* Function: gcp:compute:getRouterStatus
* Arguments:
* name: myrouter
* ```
*
* @param argument A collection of arguments for invoking RouterStatus.
* @return A collection of values returned by RouterStatus.
*/
@Deprecated(
message = """
gcp.compute.RouterStatus has been deprecated in favor of gcp.compute.getRouterStatus
""",
)
public suspend fun RouterStatus(argument: RouterStatusPlainArgs): RouterStatusResult =
routerStatusResultToKotlin(routerStatusPlain(argument.toJava()).await())
/**
* @see [RouterStatus].
* @param name The name of the router.
* @param project The ID of the project in which the resource
* belongs. If it is not provided, the provider project is used.
* @param region The region this router has been created in. If
* unspecified, this defaults to the region configured in the provider.
* @return A collection of values returned by RouterStatus.
*/
@Deprecated(
message = """
gcp.compute.RouterStatus has been deprecated in favor of gcp.compute.getRouterStatus
""",
)
public suspend fun RouterStatus(
name: String,
project: String? = null,
region: String? = null,
): RouterStatusResult {
val argument = RouterStatusPlainArgs(
name = name,
project = project,
region = region,
)
return routerStatusResultToKotlin(routerStatusPlain(argument.toJava()).await())
}
/**
* @see [RouterStatus].
* @param argument Builder for [com.pulumi.gcp.compute.kotlin.inputs.RouterStatusPlainArgs].
* @return A collection of values returned by RouterStatus.
*/
@Deprecated(
message = """
gcp.compute.RouterStatus has been deprecated in favor of gcp.compute.getRouterStatus
""",
)
public suspend fun RouterStatus(argument: suspend RouterStatusPlainArgsBuilder.() -> Unit): RouterStatusResult {
val builder = RouterStatusPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return routerStatusResultToKotlin(routerStatusPlain(builtArgument.toJava()).await())
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy