aws.servicediscovery.PrivateDnsNamespace
Explore with Pulumi AI
Provides a Service Discovery Private DNS Namespace resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.ec2.Vpc("example", {cidrBlock: "10.0.0.0/16"});
const examplePrivateDnsNamespace = new aws.servicediscovery.PrivateDnsNamespace("example", {
name: "hoge.example.local",
description: "example",
vpc: example.id,
});
import pulumi
import pulumi_aws as aws
example = aws.ec2.Vpc("example", cidr_block="10.0.0.0/16")
example_private_dns_namespace = aws.servicediscovery.PrivateDnsNamespace("example",
name="hoge.example.local",
description="example",
vpc=example.id)
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/servicediscovery"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := ec2.NewVpc(ctx, "example", &ec2.VpcArgs{
CidrBlock: pulumi.String("10.0.0.0/16"),
})
if err != nil {
return err
}
_, err = servicediscovery.NewPrivateDnsNamespace(ctx, "example", &servicediscovery.PrivateDnsNamespaceArgs{
Name: pulumi.String("hoge.example.local"),
Description: pulumi.String("example"),
Vpc: example.ID(),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Ec2.Vpc("example", new()
{
CidrBlock = "10.0.0.0/16",
});
var examplePrivateDnsNamespace = new Aws.ServiceDiscovery.PrivateDnsNamespace("example", new()
{
Name = "hoge.example.local",
Description = "example",
Vpc = example.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.Vpc;
import com.pulumi.aws.ec2.VpcArgs;
import com.pulumi.aws.servicediscovery.PrivateDnsNamespace;
import com.pulumi.aws.servicediscovery.PrivateDnsNamespaceArgs;
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 example = new Vpc("example", VpcArgs.builder()
.cidrBlock("10.0.0.0/16")
.build());
var examplePrivateDnsNamespace = new PrivateDnsNamespace("examplePrivateDnsNamespace", PrivateDnsNamespaceArgs.builder()
.name("hoge.example.local")
.description("example")
.vpc(example.id())
.build());
}
}
resources:
example:
type: aws:ec2:Vpc
properties:
cidrBlock: 10.0.0.0/16
examplePrivateDnsNamespace:
type: aws:servicediscovery:PrivateDnsNamespace
name: example
properties:
name: hoge.example.local
description: example
vpc: ${example.id}
Create PrivateDnsNamespace Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new PrivateDnsNamespace(name: string, args: PrivateDnsNamespaceArgs, opts?: CustomResourceOptions);
@overload
def PrivateDnsNamespace(resource_name: str,
args: PrivateDnsNamespaceArgs,
opts: Optional[ResourceOptions] = None)
@overload
def PrivateDnsNamespace(resource_name: str,
opts: Optional[ResourceOptions] = None,
vpc: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
func NewPrivateDnsNamespace(ctx *Context, name string, args PrivateDnsNamespaceArgs, opts ...ResourceOption) (*PrivateDnsNamespace, error)
public PrivateDnsNamespace(string name, PrivateDnsNamespaceArgs args, CustomResourceOptions? opts = null)
public PrivateDnsNamespace(String name, PrivateDnsNamespaceArgs args)
public PrivateDnsNamespace(String name, PrivateDnsNamespaceArgs args, CustomResourceOptions options)
type: aws:servicediscovery:PrivateDnsNamespace
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args PrivateDnsNamespaceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args PrivateDnsNamespaceArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args PrivateDnsNamespaceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PrivateDnsNamespaceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PrivateDnsNamespaceArgs
- 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 privateDnsNamespaceResource = new Aws.ServiceDiscovery.PrivateDnsNamespace("privateDnsNamespaceResource", new()
{
Vpc = "string",
Description = "string",
Name = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := servicediscovery.NewPrivateDnsNamespace(ctx, "privateDnsNamespaceResource", &servicediscovery.PrivateDnsNamespaceArgs{
Vpc: pulumi.String("string"),
Description: pulumi.String("string"),
Name: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var privateDnsNamespaceResource = new PrivateDnsNamespace("privateDnsNamespaceResource", PrivateDnsNamespaceArgs.builder()
.vpc("string")
.description("string")
.name("string")
.tags(Map.of("string", "string"))
.build());
private_dns_namespace_resource = aws.servicediscovery.PrivateDnsNamespace("privateDnsNamespaceResource",
vpc="string",
description="string",
name="string",
tags={
"string": "string",
})
const privateDnsNamespaceResource = new aws.servicediscovery.PrivateDnsNamespace("privateDnsNamespaceResource", {
vpc: "string",
description: "string",
name: "string",
tags: {
string: "string",
},
});
type: aws:servicediscovery:PrivateDnsNamespace
properties:
description: string
name: string
tags:
string: string
vpc: string
PrivateDnsNamespace Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The PrivateDnsNamespace resource accepts the following input properties:
- Vpc string
- The ID of VPC that you want to associate the namespace with.
- Description string
- The description that you specify for the namespace when you create it.
- Name string
- The name of the namespace.
- Dictionary<string, string>
- A map of tags to assign to the namespace. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- Vpc string
- The ID of VPC that you want to associate the namespace with.
- Description string
- The description that you specify for the namespace when you create it.
- Name string
- The name of the namespace.
- map[string]string
- A map of tags to assign to the namespace. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- vpc String
- The ID of VPC that you want to associate the namespace with.
- description String
- The description that you specify for the namespace when you create it.
- name String
- The name of the namespace.
- Map<String,String>
- A map of tags to assign to the namespace. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- vpc string
- The ID of VPC that you want to associate the namespace with.
- description string
- The description that you specify for the namespace when you create it.
- name string
- The name of the namespace.
- {[key: string]: string}
- A map of tags to assign to the namespace. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- vpc str
- The ID of VPC that you want to associate the namespace with.
- description str
- The description that you specify for the namespace when you create it.
- name str
- The name of the namespace.
- Mapping[str, str]
- A map of tags to assign to the namespace. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- vpc String
- The ID of VPC that you want to associate the namespace with.
- description String
- The description that you specify for the namespace when you create it.
- name String
- The name of the namespace.
- Map<String>
- A map of tags to assign to the namespace. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Outputs
All input properties are implicitly available as output properties. Additionally, the PrivateDnsNamespace resource produces the following output properties:
- Arn string
- The ARN that Amazon Route 53 assigns to the namespace when you create it.
- Hosted
Zone string - The ID for the hosted zone that Amazon Route 53 creates when you create a namespace.
- Id string
- The provider-assigned unique ID for this managed resource.
- Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Arn string
- The ARN that Amazon Route 53 assigns to the namespace when you create it.
- Hosted
Zone string - The ID for the hosted zone that Amazon Route 53 creates when you create a namespace.
- Id string
- The provider-assigned unique ID for this managed resource.
- map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- The ARN that Amazon Route 53 assigns to the namespace when you create it.
- hosted
Zone String - The ID for the hosted zone that Amazon Route 53 creates when you create a namespace.
- id String
- The provider-assigned unique ID for this managed resource.
- Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn string
- The ARN that Amazon Route 53 assigns to the namespace when you create it.
- hosted
Zone string - The ID for the hosted zone that Amazon Route 53 creates when you create a namespace.
- id string
- The provider-assigned unique ID for this managed resource.
- {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn str
- The ARN that Amazon Route 53 assigns to the namespace when you create it.
- hosted_
zone str - The ID for the hosted zone that Amazon Route 53 creates when you create a namespace.
- id str
- The provider-assigned unique ID for this managed resource.
- Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- The ARN that Amazon Route 53 assigns to the namespace when you create it.
- hosted
Zone String - The ID for the hosted zone that Amazon Route 53 creates when you create a namespace.
- id String
- The provider-assigned unique ID for this managed resource.
- Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
Look up Existing PrivateDnsNamespace Resource
Get an existing PrivateDnsNamespace 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?: PrivateDnsNamespaceState, opts?: CustomResourceOptions): PrivateDnsNamespace
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
description: Optional[str] = None,
hosted_zone: Optional[str] = None,
name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None,
vpc: Optional[str] = None) -> PrivateDnsNamespace
func GetPrivateDnsNamespace(ctx *Context, name string, id IDInput, state *PrivateDnsNamespaceState, opts ...ResourceOption) (*PrivateDnsNamespace, error)
public static PrivateDnsNamespace Get(string name, Input<string> id, PrivateDnsNamespaceState? state, CustomResourceOptions? opts = null)
public static PrivateDnsNamespace get(String name, Output<String> id, PrivateDnsNamespaceState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- Arn string
- The ARN that Amazon Route 53 assigns to the namespace when you create it.
- Description string
- The description that you specify for the namespace when you create it.
- Hosted
Zone string - The ID for the hosted zone that Amazon Route 53 creates when you create a namespace.
- Name string
- The name of the namespace.
- Dictionary<string, string>
- A map of tags to assign to the namespace. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - Vpc string
- The ID of VPC that you want to associate the namespace with.
- Arn string
- The ARN that Amazon Route 53 assigns to the namespace when you create it.
- Description string
- The description that you specify for the namespace when you create it.
- Hosted
Zone string - The ID for the hosted zone that Amazon Route 53 creates when you create a namespace.
- Name string
- The name of the namespace.
- map[string]string
- A map of tags to assign to the namespace. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - Vpc string
- The ID of VPC that you want to associate the namespace with.
- arn String
- The ARN that Amazon Route 53 assigns to the namespace when you create it.
- description String
- The description that you specify for the namespace when you create it.
- hosted
Zone String - The ID for the hosted zone that Amazon Route 53 creates when you create a namespace.
- name String
- The name of the namespace.
- Map<String,String>
- A map of tags to assign to the namespace. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - vpc String
- The ID of VPC that you want to associate the namespace with.
- arn string
- The ARN that Amazon Route 53 assigns to the namespace when you create it.
- description string
- The description that you specify for the namespace when you create it.
- hosted
Zone string - The ID for the hosted zone that Amazon Route 53 creates when you create a namespace.
- name string
- The name of the namespace.
- {[key: string]: string}
- A map of tags to assign to the namespace. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - vpc string
- The ID of VPC that you want to associate the namespace with.
- arn str
- The ARN that Amazon Route 53 assigns to the namespace when you create it.
- description str
- The description that you specify for the namespace when you create it.
- hosted_
zone str - The ID for the hosted zone that Amazon Route 53 creates when you create a namespace.
- name str
- The name of the namespace.
- Mapping[str, str]
- A map of tags to assign to the namespace. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - vpc str
- The ID of VPC that you want to associate the namespace with.
- arn String
- The ARN that Amazon Route 53 assigns to the namespace when you create it.
- description String
- The description that you specify for the namespace when you create it.
- hosted
Zone String - The ID for the hosted zone that Amazon Route 53 creates when you create a namespace.
- name String
- The name of the namespace.
- Map<String>
- A map of tags to assign to the namespace. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - vpc String
- The ID of VPC that you want to associate the namespace with.
Import
Using pulumi import
, import Service Discovery Private DNS Namespace using the namespace ID and VPC ID. For example:
$ pulumi import aws:servicediscovery/privateDnsNamespace:PrivateDnsNamespace example 0123456789:vpc-123345
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.