1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Core
  5. getCnvDnsResolverAssociation
Viewing docs for Oracle Cloud Infrastructure v4.2.0
published on Friday, Mar 6, 2026 by Pulumi
oci logo
Viewing docs for Oracle Cloud Infrastructure v4.2.0
published on Friday, Mar 6, 2026 by Pulumi

    This data source provides details about a specific Vcn Dns Resolver Association resource in Oracle Cloud Infrastructure Core service.

    Get the associated DNS resolver information with a vcn

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testVcnDnsResolverAssociation = oci.Core.getCnvDnsResolverAssociation({
        vcnId: testVcn.id,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_vcn_dns_resolver_association = oci.Core.get_cnv_dns_resolver_association(vcn_id=test_vcn["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v4/go/oci/core"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := core.GetCnvDnsResolverAssociation(ctx, &core.GetCnvDnsResolverAssociationArgs{
    			VcnId: testVcn.Id,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testVcnDnsResolverAssociation = Oci.Core.GetCnvDnsResolverAssociation.Invoke(new()
        {
            VcnId = testVcn.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.Core.CoreFunctions;
    import com.pulumi.oci.Core.inputs.GetCnvDnsResolverAssociationArgs;
    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 testVcnDnsResolverAssociation = CoreFunctions.getCnvDnsResolverAssociation(GetCnvDnsResolverAssociationArgs.builder()
                .vcnId(testVcn.id())
                .build());
    
        }
    }
    
    variables:
      testVcnDnsResolverAssociation:
        fn::invoke:
          function: oci:Core:getCnvDnsResolverAssociation
          arguments:
            vcnId: ${testVcn.id}
    

    Using getCnvDnsResolverAssociation

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getCnvDnsResolverAssociation(args: GetCnvDnsResolverAssociationArgs, opts?: InvokeOptions): Promise<GetCnvDnsResolverAssociationResult>
    function getCnvDnsResolverAssociationOutput(args: GetCnvDnsResolverAssociationOutputArgs, opts?: InvokeOptions): Output<GetCnvDnsResolverAssociationResult>
    def get_cnv_dns_resolver_association(vcn_id: Optional[str] = None,
                                         opts: Optional[InvokeOptions] = None) -> GetCnvDnsResolverAssociationResult
    def get_cnv_dns_resolver_association_output(vcn_id: Optional[pulumi.Input[str]] = None,
                                         opts: Optional[InvokeOptions] = None) -> Output[GetCnvDnsResolverAssociationResult]
    func GetCnvDnsResolverAssociation(ctx *Context, args *GetCnvDnsResolverAssociationArgs, opts ...InvokeOption) (*GetCnvDnsResolverAssociationResult, error)
    func GetCnvDnsResolverAssociationOutput(ctx *Context, args *GetCnvDnsResolverAssociationOutputArgs, opts ...InvokeOption) GetCnvDnsResolverAssociationResultOutput

    > Note: This function is named GetCnvDnsResolverAssociation in the Go SDK.

    public static class GetCnvDnsResolverAssociation 
    {
        public static Task<GetCnvDnsResolverAssociationResult> InvokeAsync(GetCnvDnsResolverAssociationArgs args, InvokeOptions? opts = null)
        public static Output<GetCnvDnsResolverAssociationResult> Invoke(GetCnvDnsResolverAssociationInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCnvDnsResolverAssociationResult> getCnvDnsResolverAssociation(GetCnvDnsResolverAssociationArgs args, InvokeOptions options)
    public static Output<GetCnvDnsResolverAssociationResult> getCnvDnsResolverAssociation(GetCnvDnsResolverAssociationArgs args, InvokeOptions options)
    
    fn::invoke:
      function: oci:Core/getCnvDnsResolverAssociation:getCnvDnsResolverAssociation
      arguments:
        # arguments dictionary

    The following arguments are supported:

    VcnId string
    Specify the OCID of the VCN.
    VcnId string
    Specify the OCID of the VCN.
    vcnId String
    Specify the OCID of the VCN.
    vcnId string
    Specify the OCID of the VCN.
    vcn_id str
    Specify the OCID of the VCN.
    vcnId String
    Specify the OCID of the VCN.

    getCnvDnsResolverAssociation Result

    The following output properties are available:

    DnsResolverId string
    The OCID of the DNS resolver in the association. We won't have the DNS resolver id as soon as vcn is created, we will create it asynchronously. It would be null until it is actually created.
    Id string
    The provider-assigned unique ID for this managed resource.
    State string
    The current state of the association. Resolver will be created when vcn is created. But the creation happens asynchronously and may take longer because it is a background event that needs to run. The state will be PROVISIONING until the resolver is actually created. After the resolver is actually created, the state will be set to AVAILABLE. Users need to do a terraform refresh to poll and update the state file after sometime to get the dns_resolver_id and state AVAILABLE.
    VcnId string
    The OCID of the VCN in the association.
    DnsResolverId string
    The OCID of the DNS resolver in the association. We won't have the DNS resolver id as soon as vcn is created, we will create it asynchronously. It would be null until it is actually created.
    Id string
    The provider-assigned unique ID for this managed resource.
    State string
    The current state of the association. Resolver will be created when vcn is created. But the creation happens asynchronously and may take longer because it is a background event that needs to run. The state will be PROVISIONING until the resolver is actually created. After the resolver is actually created, the state will be set to AVAILABLE. Users need to do a terraform refresh to poll and update the state file after sometime to get the dns_resolver_id and state AVAILABLE.
    VcnId string
    The OCID of the VCN in the association.
    dnsResolverId String
    The OCID of the DNS resolver in the association. We won't have the DNS resolver id as soon as vcn is created, we will create it asynchronously. It would be null until it is actually created.
    id String
    The provider-assigned unique ID for this managed resource.
    state String
    The current state of the association. Resolver will be created when vcn is created. But the creation happens asynchronously and may take longer because it is a background event that needs to run. The state will be PROVISIONING until the resolver is actually created. After the resolver is actually created, the state will be set to AVAILABLE. Users need to do a terraform refresh to poll and update the state file after sometime to get the dns_resolver_id and state AVAILABLE.
    vcnId String
    The OCID of the VCN in the association.
    dnsResolverId string
    The OCID of the DNS resolver in the association. We won't have the DNS resolver id as soon as vcn is created, we will create it asynchronously. It would be null until it is actually created.
    id string
    The provider-assigned unique ID for this managed resource.
    state string
    The current state of the association. Resolver will be created when vcn is created. But the creation happens asynchronously and may take longer because it is a background event that needs to run. The state will be PROVISIONING until the resolver is actually created. After the resolver is actually created, the state will be set to AVAILABLE. Users need to do a terraform refresh to poll and update the state file after sometime to get the dns_resolver_id and state AVAILABLE.
    vcnId string
    The OCID of the VCN in the association.
    dns_resolver_id str
    The OCID of the DNS resolver in the association. We won't have the DNS resolver id as soon as vcn is created, we will create it asynchronously. It would be null until it is actually created.
    id str
    The provider-assigned unique ID for this managed resource.
    state str
    The current state of the association. Resolver will be created when vcn is created. But the creation happens asynchronously and may take longer because it is a background event that needs to run. The state will be PROVISIONING until the resolver is actually created. After the resolver is actually created, the state will be set to AVAILABLE. Users need to do a terraform refresh to poll and update the state file after sometime to get the dns_resolver_id and state AVAILABLE.
    vcn_id str
    The OCID of the VCN in the association.
    dnsResolverId String
    The OCID of the DNS resolver in the association. We won't have the DNS resolver id as soon as vcn is created, we will create it asynchronously. It would be null until it is actually created.
    id String
    The provider-assigned unique ID for this managed resource.
    state String
    The current state of the association. Resolver will be created when vcn is created. But the creation happens asynchronously and may take longer because it is a background event that needs to run. The state will be PROVISIONING until the resolver is actually created. After the resolver is actually created, the state will be set to AVAILABLE. Users need to do a terraform refresh to poll and update the state file after sometime to get the dns_resolver_id and state AVAILABLE.
    vcnId String
    The OCID of the VCN in the association.

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Viewing docs for Oracle Cloud Infrastructure v4.2.0
    published on Friday, Mar 6, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.