Try AWS Native preview for resources not in the classic version.
aws.connect.PhoneNumber
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
Provides an Amazon Connect Phone Number resource. For more information see Amazon Connect: Getting Started
Example Usage
Basic
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Connect.PhoneNumber("example", new()
{
TargetArn = aws_connect_instance.Example.Arn,
CountryCode = "US",
Type = "DID",
Tags =
{
{ "hello", "world" },
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/connect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := connect.NewPhoneNumber(ctx, "example", &connect.PhoneNumberArgs{
TargetArn: pulumi.Any(aws_connect_instance.Example.Arn),
CountryCode: pulumi.String("US"),
Type: pulumi.String("DID"),
Tags: pulumi.StringMap{
"hello": pulumi.String("world"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.connect.PhoneNumber;
import com.pulumi.aws.connect.PhoneNumberArgs;
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 PhoneNumber("example", PhoneNumberArgs.builder()
.targetArn(aws_connect_instance.example().arn())
.countryCode("US")
.type("DID")
.tags(Map.of("hello", "world"))
.build());
}
}
import pulumi
import pulumi_aws as aws
example = aws.connect.PhoneNumber("example",
target_arn=aws_connect_instance["example"]["arn"],
country_code="US",
type="DID",
tags={
"hello": "world",
})
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.connect.PhoneNumber("example", {
targetArn: aws_connect_instance.example.arn,
countryCode: "US",
type: "DID",
tags: {
hello: "world",
},
});
resources:
example:
type: aws:connect:PhoneNumber
properties:
targetArn: ${aws_connect_instance.example.arn}
countryCode: US
type: DID
tags:
hello: world
Description
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Connect.PhoneNumber("example", new()
{
TargetArn = aws_connect_instance.Example.Arn,
CountryCode = "US",
Type = "DID",
Description = "example description",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/connect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := connect.NewPhoneNumber(ctx, "example", &connect.PhoneNumberArgs{
TargetArn: pulumi.Any(aws_connect_instance.Example.Arn),
CountryCode: pulumi.String("US"),
Type: pulumi.String("DID"),
Description: pulumi.String("example description"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.connect.PhoneNumber;
import com.pulumi.aws.connect.PhoneNumberArgs;
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 PhoneNumber("example", PhoneNumberArgs.builder()
.targetArn(aws_connect_instance.example().arn())
.countryCode("US")
.type("DID")
.description("example description")
.build());
}
}
import pulumi
import pulumi_aws as aws
example = aws.connect.PhoneNumber("example",
target_arn=aws_connect_instance["example"]["arn"],
country_code="US",
type="DID",
description="example description")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.connect.PhoneNumber("example", {
targetArn: aws_connect_instance.example.arn,
countryCode: "US",
type: "DID",
description: "example description",
});
resources:
example:
type: aws:connect:PhoneNumber
properties:
targetArn: ${aws_connect_instance.example.arn}
countryCode: US
type: DID
description: example description
Prefix to filter phone numbers
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Connect.PhoneNumber("example", new()
{
TargetArn = aws_connect_instance.Example.Arn,
CountryCode = "US",
Type = "DID",
Prefix = "+18005",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/connect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := connect.NewPhoneNumber(ctx, "example", &connect.PhoneNumberArgs{
TargetArn: pulumi.Any(aws_connect_instance.Example.Arn),
CountryCode: pulumi.String("US"),
Type: pulumi.String("DID"),
Prefix: pulumi.String("+18005"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.connect.PhoneNumber;
import com.pulumi.aws.connect.PhoneNumberArgs;
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 PhoneNumber("example", PhoneNumberArgs.builder()
.targetArn(aws_connect_instance.example().arn())
.countryCode("US")
.type("DID")
.prefix("+18005")
.build());
}
}
import pulumi
import pulumi_aws as aws
example = aws.connect.PhoneNumber("example",
target_arn=aws_connect_instance["example"]["arn"],
country_code="US",
type="DID",
prefix="+18005")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.connect.PhoneNumber("example", {
targetArn: aws_connect_instance.example.arn,
countryCode: "US",
type: "DID",
prefix: "+18005",
});
resources:
example:
type: aws:connect:PhoneNumber
properties:
targetArn: ${aws_connect_instance.example.arn}
countryCode: US
type: DID
prefix: '+18005'
Create PhoneNumber Resource
new PhoneNumber(name: string, args: PhoneNumberArgs, opts?: CustomResourceOptions);
@overload
def PhoneNumber(resource_name: str,
opts: Optional[ResourceOptions] = None,
country_code: Optional[str] = None,
description: Optional[str] = None,
prefix: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
target_arn: Optional[str] = None,
type: Optional[str] = None)
@overload
def PhoneNumber(resource_name: str,
args: PhoneNumberArgs,
opts: Optional[ResourceOptions] = None)
func NewPhoneNumber(ctx *Context, name string, args PhoneNumberArgs, opts ...ResourceOption) (*PhoneNumber, error)
public PhoneNumber(string name, PhoneNumberArgs args, CustomResourceOptions? opts = null)
public PhoneNumber(String name, PhoneNumberArgs args)
public PhoneNumber(String name, PhoneNumberArgs args, CustomResourceOptions options)
type: aws:connect:PhoneNumber
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PhoneNumberArgs
- 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 PhoneNumberArgs
- 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 PhoneNumberArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PhoneNumberArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PhoneNumberArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
PhoneNumber 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 PhoneNumber resource accepts the following input properties:
- Country
Code string The ISO country code. For a list of Valid values, refer to PhoneNumberCountryCode.
- Target
Arn string The Amazon Resource Name (ARN) for Amazon Connect instances that phone numbers are claimed to.
- Type string
The type of phone number. Valid Values:
TOLL_FREE
|DID
.- Description string
The description of the phone number.
- Prefix string
The prefix of the phone number that is used to filter available phone numbers. If provided, it must contain
+
as part of the country code. Do not specify this argument when importing the resource.- Dictionary<string, string>
Tags to apply to the Phone Number. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- Country
Code string The ISO country code. For a list of Valid values, refer to PhoneNumberCountryCode.
- Target
Arn string The Amazon Resource Name (ARN) for Amazon Connect instances that phone numbers are claimed to.
- Type string
The type of phone number. Valid Values:
TOLL_FREE
|DID
.- Description string
The description of the phone number.
- Prefix string
The prefix of the phone number that is used to filter available phone numbers. If provided, it must contain
+
as part of the country code. Do not specify this argument when importing the resource.- map[string]string
Tags to apply to the Phone Number. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- country
Code String The ISO country code. For a list of Valid values, refer to PhoneNumberCountryCode.
- target
Arn String The Amazon Resource Name (ARN) for Amazon Connect instances that phone numbers are claimed to.
- type String
The type of phone number. Valid Values:
TOLL_FREE
|DID
.- description String
The description of the phone number.
- prefix String
The prefix of the phone number that is used to filter available phone numbers. If provided, it must contain
+
as part of the country code. Do not specify this argument when importing the resource.- Map<String,String>
Tags to apply to the Phone Number. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- country
Code string The ISO country code. For a list of Valid values, refer to PhoneNumberCountryCode.
- target
Arn string The Amazon Resource Name (ARN) for Amazon Connect instances that phone numbers are claimed to.
- type string
The type of phone number. Valid Values:
TOLL_FREE
|DID
.- description string
The description of the phone number.
- prefix string
The prefix of the phone number that is used to filter available phone numbers. If provided, it must contain
+
as part of the country code. Do not specify this argument when importing the resource.- {[key: string]: string}
Tags to apply to the Phone Number. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- country_
code str The ISO country code. For a list of Valid values, refer to PhoneNumberCountryCode.
- target_
arn str The Amazon Resource Name (ARN) for Amazon Connect instances that phone numbers are claimed to.
- type str
The type of phone number. Valid Values:
TOLL_FREE
|DID
.- description str
The description of the phone number.
- prefix str
The prefix of the phone number that is used to filter available phone numbers. If provided, it must contain
+
as part of the country code. Do not specify this argument when importing the resource.- Mapping[str, str]
Tags to apply to the Phone Number. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- country
Code String The ISO country code. For a list of Valid values, refer to PhoneNumberCountryCode.
- target
Arn String The Amazon Resource Name (ARN) for Amazon Connect instances that phone numbers are claimed to.
- type String
The type of phone number. Valid Values:
TOLL_FREE
|DID
.- description String
The description of the phone number.
- prefix String
The prefix of the phone number that is used to filter available phone numbers. If provided, it must contain
+
as part of the country code. Do not specify this argument when importing the resource.- Map<String>
Tags to apply to the Phone Number. 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 PhoneNumber resource produces the following output properties:
- Arn string
The ARN of the phone number.
- Id string
The provider-assigned unique ID for this managed resource.
- Phone
Number stringValue The phone number. Phone numbers are formatted
[+] [country code] [subscriber number including area code]
.- Statuses
List<Phone
Number Status> The status of the phone number. Valid Values:
CLAIMED
|IN_PROGRESS
|FAILED
.- Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- Arn string
The ARN of the phone number.
- Id string
The provider-assigned unique ID for this managed resource.
- Phone
Number string The phone number. Phone numbers are formatted
[+] [country code] [subscriber number including area code]
.- Statuses
[]Phone
Number Status The status of the phone number. Valid Values:
CLAIMED
|IN_PROGRESS
|FAILED
.- map[string]string
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn String
The ARN of the phone number.
- id String
The provider-assigned unique ID for this managed resource.
- phone
Number String The phone number. Phone numbers are formatted
[+] [country code] [subscriber number including area code]
.- statuses
List<Phone
Number Status> The status of the phone number. Valid Values:
CLAIMED
|IN_PROGRESS
|FAILED
.- Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn string
The ARN of the phone number.
- id string
The provider-assigned unique ID for this managed resource.
- phone
Number string The phone number. Phone numbers are formatted
[+] [country code] [subscriber number including area code]
.- statuses
Phone
Number Status[] The status of the phone number. Valid Values:
CLAIMED
|IN_PROGRESS
|FAILED
.- {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn str
The ARN of the phone number.
- id str
The provider-assigned unique ID for this managed resource.
- phone_
number str The phone number. Phone numbers are formatted
[+] [country code] [subscriber number including area code]
.- statuses
Sequence[Phone
Number Status] The status of the phone number. Valid Values:
CLAIMED
|IN_PROGRESS
|FAILED
.- Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn String
The ARN of the phone number.
- id String
The provider-assigned unique ID for this managed resource.
- phone
Number String The phone number. Phone numbers are formatted
[+] [country code] [subscriber number including area code]
.- statuses List<Property Map>
The status of the phone number. Valid Values:
CLAIMED
|IN_PROGRESS
|FAILED
.- Map<String>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
Look up Existing PhoneNumber Resource
Get an existing PhoneNumber 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?: PhoneNumberState, opts?: CustomResourceOptions): PhoneNumber
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
country_code: Optional[str] = None,
description: Optional[str] = None,
phone_number: Optional[str] = None,
prefix: Optional[str] = None,
statuses: Optional[Sequence[PhoneNumberStatusArgs]] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None,
target_arn: Optional[str] = None,
type: Optional[str] = None) -> PhoneNumber
func GetPhoneNumber(ctx *Context, name string, id IDInput, state *PhoneNumberState, opts ...ResourceOption) (*PhoneNumber, error)
public static PhoneNumber Get(string name, Input<string> id, PhoneNumberState? state, CustomResourceOptions? opts = null)
public static PhoneNumber get(String name, Output<String> id, PhoneNumberState 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 of the phone number.
- Country
Code string The ISO country code. For a list of Valid values, refer to PhoneNumberCountryCode.
- Description string
The description of the phone number.
- Phone
Number stringValue The phone number. Phone numbers are formatted
[+] [country code] [subscriber number including area code]
.- Prefix string
The prefix of the phone number that is used to filter available phone numbers. If provided, it must contain
+
as part of the country code. Do not specify this argument when importing the resource.- Statuses
List<Phone
Number Status> The status of the phone number. Valid Values:
CLAIMED
|IN_PROGRESS
|FAILED
.- Dictionary<string, string>
Tags to apply to the Phone Number. 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.Please use
tags
instead.- Target
Arn string The Amazon Resource Name (ARN) for Amazon Connect instances that phone numbers are claimed to.
- Type string
The type of phone number. Valid Values:
TOLL_FREE
|DID
.
- Arn string
The ARN of the phone number.
- Country
Code string The ISO country code. For a list of Valid values, refer to PhoneNumberCountryCode.
- Description string
The description of the phone number.
- Phone
Number string The phone number. Phone numbers are formatted
[+] [country code] [subscriber number including area code]
.- Prefix string
The prefix of the phone number that is used to filter available phone numbers. If provided, it must contain
+
as part of the country code. Do not specify this argument when importing the resource.- Statuses
[]Phone
Number Status Args The status of the phone number. Valid Values:
CLAIMED
|IN_PROGRESS
|FAILED
.- map[string]string
Tags to apply to the Phone Number. 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.Please use
tags
instead.- Target
Arn string The Amazon Resource Name (ARN) for Amazon Connect instances that phone numbers are claimed to.
- Type string
The type of phone number. Valid Values:
TOLL_FREE
|DID
.
- arn String
The ARN of the phone number.
- country
Code String The ISO country code. For a list of Valid values, refer to PhoneNumberCountryCode.
- description String
The description of the phone number.
- phone
Number String The phone number. Phone numbers are formatted
[+] [country code] [subscriber number including area code]
.- prefix String
The prefix of the phone number that is used to filter available phone numbers. If provided, it must contain
+
as part of the country code. Do not specify this argument when importing the resource.- statuses
List<Phone
Number Status> The status of the phone number. Valid Values:
CLAIMED
|IN_PROGRESS
|FAILED
.- Map<String,String>
Tags to apply to the Phone Number. 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.Please use
tags
instead.- target
Arn String The Amazon Resource Name (ARN) for Amazon Connect instances that phone numbers are claimed to.
- type String
The type of phone number. Valid Values:
TOLL_FREE
|DID
.
- arn string
The ARN of the phone number.
- country
Code string The ISO country code. For a list of Valid values, refer to PhoneNumberCountryCode.
- description string
The description of the phone number.
- phone
Number string The phone number. Phone numbers are formatted
[+] [country code] [subscriber number including area code]
.- prefix string
The prefix of the phone number that is used to filter available phone numbers. If provided, it must contain
+
as part of the country code. Do not specify this argument when importing the resource.- statuses
Phone
Number Status[] The status of the phone number. Valid Values:
CLAIMED
|IN_PROGRESS
|FAILED
.- {[key: string]: string}
Tags to apply to the Phone Number. 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.Please use
tags
instead.- target
Arn string The Amazon Resource Name (ARN) for Amazon Connect instances that phone numbers are claimed to.
- type string
The type of phone number. Valid Values:
TOLL_FREE
|DID
.
- arn str
The ARN of the phone number.
- country_
code str The ISO country code. For a list of Valid values, refer to PhoneNumberCountryCode.
- description str
The description of the phone number.
- phone_
number str The phone number. Phone numbers are formatted
[+] [country code] [subscriber number including area code]
.- prefix str
The prefix of the phone number that is used to filter available phone numbers. If provided, it must contain
+
as part of the country code. Do not specify this argument when importing the resource.- statuses
Sequence[Phone
Number Status Args] The status of the phone number. Valid Values:
CLAIMED
|IN_PROGRESS
|FAILED
.- Mapping[str, str]
Tags to apply to the Phone Number. 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.Please use
tags
instead.- target_
arn str The Amazon Resource Name (ARN) for Amazon Connect instances that phone numbers are claimed to.
- type str
The type of phone number. Valid Values:
TOLL_FREE
|DID
.
- arn String
The ARN of the phone number.
- country
Code String The ISO country code. For a list of Valid values, refer to PhoneNumberCountryCode.
- description String
The description of the phone number.
- phone
Number String The phone number. Phone numbers are formatted
[+] [country code] [subscriber number including area code]
.- prefix String
The prefix of the phone number that is used to filter available phone numbers. If provided, it must contain
+
as part of the country code. Do not specify this argument when importing the resource.- statuses List<Property Map>
The status of the phone number. Valid Values:
CLAIMED
|IN_PROGRESS
|FAILED
.- Map<String>
Tags to apply to the Phone Number. 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.Please use
tags
instead.- target
Arn String The Amazon Resource Name (ARN) for Amazon Connect instances that phone numbers are claimed to.
- type String
The type of phone number. Valid Values:
TOLL_FREE
|DID
.
Supporting Types
PhoneNumberStatus, PhoneNumberStatusArgs
Import
Using pulumi import
, import Amazon Connect Phone Numbers using its id
. For example:
$ pulumi import aws:connect/phoneNumber:PhoneNumber example 12345678-abcd-1234-efgh-9876543210ab
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.