1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Dns
  5. View
Oracle Cloud Infrastructure v2.29.0 published on Wednesday, Apr 9, 2025 by Pulumi

oci.Dns.View

Explore with Pulumi AI

This resource provides the View resource in Oracle Cloud Infrastructure DNS service.

Creates a new view in the specified compartment.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testView = new oci.dns.View("test_view", {
    compartmentId: compartmentId,
    scope: "PRIVATE",
    definedTags: viewDefinedTags,
    displayName: viewDisplayName,
    freeformTags: viewFreeformTags,
});
Copy
import pulumi
import pulumi_oci as oci

test_view = oci.dns.View("test_view",
    compartment_id=compartment_id,
    scope="PRIVATE",
    defined_tags=view_defined_tags,
    display_name=view_display_name,
    freeform_tags=view_freeform_tags)
Copy
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/dns"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := dns.NewView(ctx, "test_view", &dns.ViewArgs{
			CompartmentId: pulumi.Any(compartmentId),
			Scope:         pulumi.String("PRIVATE"),
			DefinedTags:   pulumi.Any(viewDefinedTags),
			DisplayName:   pulumi.Any(viewDisplayName),
			FreeformTags:  pulumi.Any(viewFreeformTags),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testView = new Oci.Dns.View("test_view", new()
    {
        CompartmentId = compartmentId,
        Scope = "PRIVATE",
        DefinedTags = viewDefinedTags,
        DisplayName = viewDisplayName,
        FreeformTags = viewFreeformTags,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Dns.View;
import com.pulumi.oci.Dns.ViewArgs;
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 testView = new View("testView", ViewArgs.builder()
            .compartmentId(compartmentId)
            .scope("PRIVATE")
            .definedTags(viewDefinedTags)
            .displayName(viewDisplayName)
            .freeformTags(viewFreeformTags)
            .build());

    }
}
Copy
resources:
  testView:
    type: oci:Dns:View
    name: test_view
    properties:
      compartmentId: ${compartmentId}
      scope: PRIVATE
      definedTags: ${viewDefinedTags}
      displayName: ${viewDisplayName}
      freeformTags: ${viewFreeformTags}
Copy

Create View Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new View(name: string, args: ViewArgs, opts?: CustomResourceOptions);
@overload
def View(resource_name: str,
         args: ViewArgs,
         opts: Optional[ResourceOptions] = None)

@overload
def View(resource_name: str,
         opts: Optional[ResourceOptions] = None,
         compartment_id: Optional[str] = None,
         defined_tags: Optional[Mapping[str, str]] = None,
         display_name: Optional[str] = None,
         freeform_tags: Optional[Mapping[str, str]] = None,
         scope: Optional[str] = None)
func NewView(ctx *Context, name string, args ViewArgs, opts ...ResourceOption) (*View, error)
public View(string name, ViewArgs args, CustomResourceOptions? opts = null)
public View(String name, ViewArgs args)
public View(String name, ViewArgs args, CustomResourceOptions options)
type: oci:Dns:View
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ViewArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ViewArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ViewArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ViewArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ViewArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var viewResource = new Oci.Dns.View("viewResource", new()
{
    CompartmentId = "string",
    DefinedTags = 
    {
        { "string", "string" },
    },
    DisplayName = "string",
    FreeformTags = 
    {
        { "string", "string" },
    },
    Scope = "string",
});
Copy
example, err := Dns.NewView(ctx, "viewResource", &Dns.ViewArgs{
	CompartmentId: pulumi.String("string"),
	DefinedTags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	DisplayName: pulumi.String("string"),
	FreeformTags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Scope: pulumi.String("string"),
})
Copy
var viewResource = new View("viewResource", ViewArgs.builder()
    .compartmentId("string")
    .definedTags(Map.of("string", "string"))
    .displayName("string")
    .freeformTags(Map.of("string", "string"))
    .scope("string")
    .build());
Copy
view_resource = oci.dns.View("viewResource",
    compartment_id="string",
    defined_tags={
        "string": "string",
    },
    display_name="string",
    freeform_tags={
        "string": "string",
    },
    scope="string")
Copy
const viewResource = new oci.dns.View("viewResource", {
    compartmentId: "string",
    definedTags: {
        string: "string",
    },
    displayName: "string",
    freeformTags: {
        string: "string",
    },
    scope: "string",
});
Copy
type: oci:Dns:View
properties:
    compartmentId: string
    definedTags:
        string: string
    displayName: string
    freeformTags:
        string: string
    scope: string
Copy

View Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The View resource accepts the following input properties:

CompartmentId This property is required. string
(Updatable) The OCID of the owning compartment.
DefinedTags Dictionary<string, string>

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.

Example: {"Operations": {"CostCenter": "42"}}

DisplayName string
(Updatable) The display name of the view.
FreeformTags Dictionary<string, string>

(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.

Example: {"Department": "Finance"}

Scope Changes to this property will trigger replacement. string

If specified, must be PRIVATE when creating a view for private zones.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

CompartmentId This property is required. string
(Updatable) The OCID of the owning compartment.
DefinedTags map[string]string

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.

Example: {"Operations": {"CostCenter": "42"}}

DisplayName string
(Updatable) The display name of the view.
FreeformTags map[string]string

(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.

Example: {"Department": "Finance"}

Scope Changes to this property will trigger replacement. string

If specified, must be PRIVATE when creating a view for private zones.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

compartmentId This property is required. String
(Updatable) The OCID of the owning compartment.
definedTags Map<String,String>

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.

Example: {"Operations": {"CostCenter": "42"}}

displayName String
(Updatable) The display name of the view.
freeformTags Map<String,String>

(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.

Example: {"Department": "Finance"}

scope Changes to this property will trigger replacement. String

If specified, must be PRIVATE when creating a view for private zones.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

compartmentId This property is required. string
(Updatable) The OCID of the owning compartment.
definedTags {[key: string]: string}

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.

Example: {"Operations": {"CostCenter": "42"}}

displayName string
(Updatable) The display name of the view.
freeformTags {[key: string]: string}

(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.

Example: {"Department": "Finance"}

scope Changes to this property will trigger replacement. string

If specified, must be PRIVATE when creating a view for private zones.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

compartment_id This property is required. str
(Updatable) The OCID of the owning compartment.
defined_tags Mapping[str, str]

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.

Example: {"Operations": {"CostCenter": "42"}}

display_name str
(Updatable) The display name of the view.
freeform_tags Mapping[str, str]

(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.

Example: {"Department": "Finance"}

scope Changes to this property will trigger replacement. str

If specified, must be PRIVATE when creating a view for private zones.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

compartmentId This property is required. String
(Updatable) The OCID of the owning compartment.
definedTags Map<String>

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.

Example: {"Operations": {"CostCenter": "42"}}

displayName String
(Updatable) The display name of the view.
freeformTags Map<String>

(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.

Example: {"Department": "Finance"}

scope Changes to this property will trigger replacement. String

If specified, must be PRIVATE when creating a view for private zones.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

Outputs

All input properties are implicitly available as output properties. Additionally, the View resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
IsProtected bool
A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed.
Self string
The canonical absolute URL of the resource.
State string
The current state of the resource.
TimeCreated string
The date and time the resource was created in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
TimeUpdated string
The date and time the resource was last updated in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
Id string
The provider-assigned unique ID for this managed resource.
IsProtected bool
A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed.
Self string
The canonical absolute URL of the resource.
State string
The current state of the resource.
TimeCreated string
The date and time the resource was created in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
TimeUpdated string
The date and time the resource was last updated in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
id String
The provider-assigned unique ID for this managed resource.
isProtected Boolean
A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed.
self String
The canonical absolute URL of the resource.
state String
The current state of the resource.
timeCreated String
The date and time the resource was created in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
timeUpdated String
The date and time the resource was last updated in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
id string
The provider-assigned unique ID for this managed resource.
isProtected boolean
A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed.
self string
The canonical absolute URL of the resource.
state string
The current state of the resource.
timeCreated string
The date and time the resource was created in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
timeUpdated string
The date and time the resource was last updated in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
id str
The provider-assigned unique ID for this managed resource.
is_protected bool
A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed.
self str
The canonical absolute URL of the resource.
state str
The current state of the resource.
time_created str
The date and time the resource was created in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
time_updated str
The date and time the resource was last updated in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
id String
The provider-assigned unique ID for this managed resource.
isProtected Boolean
A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed.
self String
The canonical absolute URL of the resource.
state String
The current state of the resource.
timeCreated String
The date and time the resource was created in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
timeUpdated String
The date and time the resource was last updated in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.

Look up Existing View Resource

Get an existing View resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ViewState, opts?: CustomResourceOptions): View
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        compartment_id: Optional[str] = None,
        defined_tags: Optional[Mapping[str, str]] = None,
        display_name: Optional[str] = None,
        freeform_tags: Optional[Mapping[str, str]] = None,
        is_protected: Optional[bool] = None,
        scope: Optional[str] = None,
        self: Optional[str] = None,
        state: Optional[str] = None,
        time_created: Optional[str] = None,
        time_updated: Optional[str] = None) -> View
func GetView(ctx *Context, name string, id IDInput, state *ViewState, opts ...ResourceOption) (*View, error)
public static View Get(string name, Input<string> id, ViewState? state, CustomResourceOptions? opts = null)
public static View get(String name, Output<String> id, ViewState state, CustomResourceOptions options)
resources:  _:    type: oci:Dns:View    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
CompartmentId string
(Updatable) The OCID of the owning compartment.
DefinedTags Dictionary<string, string>

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.

Example: {"Operations": {"CostCenter": "42"}}

DisplayName string
(Updatable) The display name of the view.
FreeformTags Dictionary<string, string>

(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.

Example: {"Department": "Finance"}

IsProtected bool
A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed.
Scope Changes to this property will trigger replacement. string

If specified, must be PRIVATE when creating a view for private zones.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

Self string
The canonical absolute URL of the resource.
State string
The current state of the resource.
TimeCreated string
The date and time the resource was created in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
TimeUpdated string
The date and time the resource was last updated in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
CompartmentId string
(Updatable) The OCID of the owning compartment.
DefinedTags map[string]string

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.

Example: {"Operations": {"CostCenter": "42"}}

DisplayName string
(Updatable) The display name of the view.
FreeformTags map[string]string

(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.

Example: {"Department": "Finance"}

IsProtected bool
A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed.
Scope Changes to this property will trigger replacement. string

If specified, must be PRIVATE when creating a view for private zones.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

Self string
The canonical absolute URL of the resource.
State string
The current state of the resource.
TimeCreated string
The date and time the resource was created in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
TimeUpdated string
The date and time the resource was last updated in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
compartmentId String
(Updatable) The OCID of the owning compartment.
definedTags Map<String,String>

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.

Example: {"Operations": {"CostCenter": "42"}}

displayName String
(Updatable) The display name of the view.
freeformTags Map<String,String>

(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.

Example: {"Department": "Finance"}

isProtected Boolean
A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed.
scope Changes to this property will trigger replacement. String

If specified, must be PRIVATE when creating a view for private zones.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

self String
The canonical absolute URL of the resource.
state String
The current state of the resource.
timeCreated String
The date and time the resource was created in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
timeUpdated String
The date and time the resource was last updated in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
compartmentId string
(Updatable) The OCID of the owning compartment.
definedTags {[key: string]: string}

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.

Example: {"Operations": {"CostCenter": "42"}}

displayName string
(Updatable) The display name of the view.
freeformTags {[key: string]: string}

(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.

Example: {"Department": "Finance"}

isProtected boolean
A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed.
scope Changes to this property will trigger replacement. string

If specified, must be PRIVATE when creating a view for private zones.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

self string
The canonical absolute URL of the resource.
state string
The current state of the resource.
timeCreated string
The date and time the resource was created in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
timeUpdated string
The date and time the resource was last updated in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
compartment_id str
(Updatable) The OCID of the owning compartment.
defined_tags Mapping[str, str]

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.

Example: {"Operations": {"CostCenter": "42"}}

display_name str
(Updatable) The display name of the view.
freeform_tags Mapping[str, str]

(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.

Example: {"Department": "Finance"}

is_protected bool
A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed.
scope Changes to this property will trigger replacement. str

If specified, must be PRIVATE when creating a view for private zones.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

self str
The canonical absolute URL of the resource.
state str
The current state of the resource.
time_created str
The date and time the resource was created in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
time_updated str
The date and time the resource was last updated in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
compartmentId String
(Updatable) The OCID of the owning compartment.
definedTags Map<String>

(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.

Example: {"Operations": {"CostCenter": "42"}}

displayName String
(Updatable) The display name of the view.
freeformTags Map<String>

(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.

Example: {"Department": "Finance"}

isProtected Boolean
A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed.
scope Changes to this property will trigger replacement. String

If specified, must be PRIVATE when creating a view for private zones.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

self String
The canonical absolute URL of the resource.
state String
The current state of the resource.
timeCreated String
The date and time the resource was created in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
timeUpdated String
The date and time the resource was last updated in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.

Import

Views can be imported using their OCID, e.g.

$ pulumi import oci:Dns/view:View test_view "id"
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.