Class CfnPhoneNumber
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.smsvoice.CfnPhoneNumber
- All Implemented Interfaces:
IInspectable,IEnvironmentAware,IPhoneNumberRef,ITaggableV2,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-13T16:10:14.598Z")
@Stability(Stable)
public class CfnPhoneNumber
extends CfnResource
implements IInspectable, IPhoneNumberRef, ITaggableV2
Request an origination phone number for use in your account.
For more information on phone number request see Request a phone number in the End User Messaging User Guide .
Registering phone numbers is not supported by AWS CloudFormation . You can import phone numbers and sender IDs that are automatically provisioned at registration.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.smsvoice.*;
CfnPhoneNumber cfnPhoneNumber = CfnPhoneNumber.Builder.create(this, "MyCfnPhoneNumber")
.isoCountryCode("isoCountryCode")
.mandatoryKeywords(MandatoryKeywordsProperty.builder()
.help(MandatoryKeywordProperty.builder()
.message("message")
.build())
.stop(MandatoryKeywordProperty.builder()
.message("message")
.build())
.build())
.numberCapabilities(List.of("numberCapabilities"))
.numberType("numberType")
// the properties below are optional
.deletionProtectionEnabled(false)
.optionalKeywords(List.of(OptionalKeywordProperty.builder()
.action("action")
.keyword("keyword")
.message("message")
.build()))
.optOutListName("optOutListName")
.selfManagedOptOutsEnabled(false)
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.twoWay(TwoWayProperty.builder()
.enabled(false)
// the properties below are optional
.channelArn("channelArn")
.channelRole("channelRole")
.build())
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnPhoneNumber.static interfaceThe keywordsHELPandSTOPare mandatory keywords that each phone number must have.static interfaceThe keywordsHELPandSTOPare mandatory keywords that each phone number must have.static interfaceTheOptionalKeywordconfiguration.static interfaceThe phone number's two-way SMS configuration object.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.smsvoice.IPhoneNumberRef
IPhoneNumberRef.Jsii$Default, IPhoneNumberRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggableV2
ITaggableV2.Jsii$Default, ITaggableV2.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnPhoneNumber(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnPhoneNumber(software.amazon.jsii.JsiiObjectRef objRef) CfnPhoneNumber(software.constructs.Construct scope, String id, CfnPhoneNumberProps props) Create a newAWS::SMSVOICE::PhoneNumber. -
Method Summary
Modifier and TypeMethodDescriptionstatic IPhoneNumberReffromPhoneNumberArn(software.constructs.Construct scope, String id, String arn) Creates a new IPhoneNumberRef from an ARN.static IPhoneNumberReffromPhoneNumberId(software.constructs.Construct scope, String id, String phoneNumberId) Creates a new IPhoneNumberRef from a phoneNumberId.ThePhoneNumber's Amazon Resource Name (ARN).The phone number in E.164 format.The unique identifier for the phone number.Tag Manager which manages the tags for this resource.By default this is set to false.The two-character code, in ISO 3166-1 alpha-2 format, for the country or region.Creates or updates aMandatoryKeywordconfiguration on an origination phone number For more information, see Keywords in the End User Messaging User Guide.Indicates if the phone number will be used for text messages, voice messages, or both.The type of phone number to request.A keyword is a word that you can search for on a particular phone number or pool.The name of the OptOutList associated with the phone number.A reference to a PhoneNumber resource.When set to false and an end recipient sends a message that begins with HELP or STOP to one of your dedicated numbers, End User Messaging automatically replies with a customizable message and adds the end recipient to the OptOutList.getTags()An array of tags (key and value pairs) to associate with the requested phone number.Describes the two-way SMS configuration for a phone number.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidBy default this is set to false.voidBy default this is set to false.voidsetIsoCountryCode(String value) The two-character code, in ISO 3166-1 alpha-2 format, for the country or region.voidsetMandatoryKeywords(IResolvable value) Creates or updates aMandatoryKeywordconfiguration on an origination phone number For more information, see Keywords in the End User Messaging User Guide.voidCreates or updates aMandatoryKeywordconfiguration on an origination phone number For more information, see Keywords in the End User Messaging User Guide.voidsetNumberCapabilities(List<String> value) Indicates if the phone number will be used for text messages, voice messages, or both.voidsetNumberType(String value) The type of phone number to request.voidsetOptionalKeywords(List<Object> value) A keyword is a word that you can search for on a particular phone number or pool.voidsetOptionalKeywords(IResolvable value) A keyword is a word that you can search for on a particular phone number or pool.voidsetOptOutListName(String value) The name of the OptOutList associated with the phone number.voidWhen set to false and an end recipient sends a message that begins with HELP or STOP to one of your dedicated numbers, End User Messaging automatically replies with a customizable message and adds the end recipient to the OptOutList.voidWhen set to false and an end recipient sends a message that begins with HELP or STOP to one of your dedicated numbers, End User Messaging automatically replies with a customizable message and adds the end recipient to the OptOutList.voidAn array of tags (key and value pairs) to associate with the requested phone number.voidsetTwoWay(IResolvable value) Describes the two-way SMS configuration for a phone number.voidDescribes the two-way SMS configuration for a phone number.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnPhoneNumber
protected CfnPhoneNumber(software.amazon.jsii.JsiiObjectRef objRef) -
CfnPhoneNumber
protected CfnPhoneNumber(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnPhoneNumber
@Stability(Stable) public CfnPhoneNumber(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnPhoneNumberProps props) Create a newAWS::SMSVOICE::PhoneNumber.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
fromPhoneNumberArn
@Stability(Stable) @NotNull public static IPhoneNumberRef fromPhoneNumberArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String arn) Creates a new IPhoneNumberRef from an ARN.- Parameters:
scope- This parameter is required.id- This parameter is required.arn- This parameter is required.
-
fromPhoneNumberId
@Stability(Stable) @NotNull public static IPhoneNumberRef fromPhoneNumberId(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String phoneNumberId) Creates a new IPhoneNumberRef from a phoneNumberId.- Parameters:
scope- This parameter is required.id- This parameter is required.phoneNumberId- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrArn
ThePhoneNumber's Amazon Resource Name (ARN). -
getAttrPhoneNumber
The phone number in E.164 format. -
getAttrPhoneNumberId
The unique identifier for the phone number. -
getCdkTagManager
Tag Manager which manages the tags for this resource.- Specified by:
getCdkTagManagerin interfaceITaggableV2
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getPhoneNumberRef
A reference to a PhoneNumber resource.- Specified by:
getPhoneNumberRefin interfaceIPhoneNumberRef
-
getIsoCountryCode
The two-character code, in ISO 3166-1 alpha-2 format, for the country or region. -
setIsoCountryCode
The two-character code, in ISO 3166-1 alpha-2 format, for the country or region. -
getMandatoryKeywords
Creates or updates aMandatoryKeywordconfiguration on an origination phone number For more information, see Keywords in the End User Messaging User Guide.Returns union: either
IResolvableorCfnPhoneNumber.MandatoryKeywordsProperty -
setMandatoryKeywords
Creates or updates aMandatoryKeywordconfiguration on an origination phone number For more information, see Keywords in the End User Messaging User Guide. -
setMandatoryKeywords
@Stability(Stable) public void setMandatoryKeywords(@NotNull CfnPhoneNumber.MandatoryKeywordsProperty value) Creates or updates aMandatoryKeywordconfiguration on an origination phone number For more information, see Keywords in the End User Messaging User Guide. -
getNumberCapabilities
Indicates if the phone number will be used for text messages, voice messages, or both. -
setNumberCapabilities
Indicates if the phone number will be used for text messages, voice messages, or both. -
getNumberType
The type of phone number to request. -
setNumberType
The type of phone number to request. -
getDeletionProtectionEnabled
By default this is set to false.Returns union: either
BooleanorIResolvable -
setDeletionProtectionEnabled
By default this is set to false. -
setDeletionProtectionEnabled
By default this is set to false. -
getOptionalKeywords
A keyword is a word that you can search for on a particular phone number or pool.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnPhoneNumber.OptionalKeywordProperty> -
setOptionalKeywords
A keyword is a word that you can search for on a particular phone number or pool. -
setOptionalKeywords
A keyword is a word that you can search for on a particular phone number or pool. -
getOptOutListName
The name of the OptOutList associated with the phone number. -
setOptOutListName
The name of the OptOutList associated with the phone number. -
getSelfManagedOptOutsEnabled
When set to false and an end recipient sends a message that begins with HELP or STOP to one of your dedicated numbers, End User Messaging automatically replies with a customizable message and adds the end recipient to the OptOutList.Returns union: either
BooleanorIResolvable -
setSelfManagedOptOutsEnabled
When set to false and an end recipient sends a message that begins with HELP or STOP to one of your dedicated numbers, End User Messaging automatically replies with a customizable message and adds the end recipient to the OptOutList. -
setSelfManagedOptOutsEnabled
When set to false and an end recipient sends a message that begins with HELP or STOP to one of your dedicated numbers, End User Messaging automatically replies with a customizable message and adds the end recipient to the OptOutList. -
getTags
An array of tags (key and value pairs) to associate with the requested phone number. -
setTags
An array of tags (key and value pairs) to associate with the requested phone number. -
getTwoWay
Describes the two-way SMS configuration for a phone number.Returns union: either
IResolvableorCfnPhoneNumber.TwoWayProperty -
setTwoWay
Describes the two-way SMS configuration for a phone number. -
setTwoWay
Describes the two-way SMS configuration for a phone number.
-