Class CfnPhoneNumber

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggableV2, IPhoneNumberRef, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.113.0 (build fc68b25)", date="2025-09-25T11:29:17.631Z") @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:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String 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)
      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

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      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:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The PhoneNumber 's Amazon Resource Name (ARN).
    • getAttrPhoneNumber

      @Stability(Stable) @NotNull public String getAttrPhoneNumber()
      The phone number in E.164 format.
    • getAttrPhoneNumberId

      @Stability(Stable) @NotNull public String getAttrPhoneNumberId()
      The unique identifier for the phone number.
    • getCdkTagManager

      @Stability(Stable) @NotNull public TagManager getCdkTagManager()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getCdkTagManager in interface ITaggableV2
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getPhoneNumberRef

      @Stability(Stable) @NotNull public PhoneNumberReference getPhoneNumberRef()
      A reference to a PhoneNumber resource.
      Specified by:
      getPhoneNumberRef in interface IPhoneNumberRef
    • getIsoCountryCode

      @Stability(Stable) @NotNull public String getIsoCountryCode()
      The two-character code, in ISO 3166-1 alpha-2 format, for the country or region.
    • setIsoCountryCode

      @Stability(Stable) public void setIsoCountryCode(@NotNull String value)
      The two-character code, in ISO 3166-1 alpha-2 format, for the country or region.
    • getMandatoryKeywords

      @Stability(Stable) @NotNull public Object getMandatoryKeywords()
      Creates or updates a MandatoryKeyword configuration on an origination phone number For more information, see Keywords in the End User Messaging User Guide.
    • setMandatoryKeywords

      @Stability(Stable) public void setMandatoryKeywords(@NotNull IResolvable value)
      Creates or updates a MandatoryKeyword configuration 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 a MandatoryKeyword configuration on an origination phone number For more information, see Keywords in the End User Messaging User Guide.
    • getNumberCapabilities

      @Stability(Stable) @NotNull public List<String> getNumberCapabilities()
      Indicates if the phone number will be used for text messages, voice messages, or both.
    • setNumberCapabilities

      @Stability(Stable) public void setNumberCapabilities(@NotNull List<String> value)
      Indicates if the phone number will be used for text messages, voice messages, or both.
    • getNumberType

      @Stability(Stable) @NotNull public String getNumberType()
      The type of phone number to request.
    • setNumberType

      @Stability(Stable) public void setNumberType(@NotNull String value)
      The type of phone number to request.
    • getDeletionProtectionEnabled

      @Stability(Stable) @Nullable public Object getDeletionProtectionEnabled()
      By default this is set to false.
    • setDeletionProtectionEnabled

      @Stability(Stable) public void setDeletionProtectionEnabled(@Nullable Boolean value)
      By default this is set to false.
    • setDeletionProtectionEnabled

      @Stability(Stable) public void setDeletionProtectionEnabled(@Nullable IResolvable value)
      By default this is set to false.
    • getOptionalKeywords

      @Stability(Stable) @Nullable public Object getOptionalKeywords()
      A keyword is a word that you can search for on a particular phone number or pool.
    • setOptionalKeywords

      @Stability(Stable) public void setOptionalKeywords(@Nullable IResolvable value)
      A keyword is a word that you can search for on a particular phone number or pool.
    • setOptionalKeywords

      @Stability(Stable) public void setOptionalKeywords(@Nullable List<Object> value)
      A keyword is a word that you can search for on a particular phone number or pool.
    • getOptOutListName

      @Stability(Stable) @Nullable public String getOptOutListName()
      The name of the OptOutList associated with the phone number.
    • setOptOutListName

      @Stability(Stable) public void setOptOutListName(@Nullable String value)
      The name of the OptOutList associated with the phone number.
    • getSelfManagedOptOutsEnabled

      @Stability(Stable) @Nullable public Object 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.
    • setSelfManagedOptOutsEnabled

      @Stability(Stable) public void setSelfManagedOptOutsEnabled(@Nullable Boolean value)
      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

      @Stability(Stable) public void setSelfManagedOptOutsEnabled(@Nullable IResolvable value)
      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

      @Stability(Stable) @Nullable public List<CfnTag> getTags()
      An array of tags (key and value pairs) to associate with the requested phone number.
    • setTags

      @Stability(Stable) public void setTags(@Nullable List<CfnTag> value)
      An array of tags (key and value pairs) to associate with the requested phone number.
    • getTwoWay

      @Stability(Stable) @Nullable public Object getTwoWay()
      Describes the two-way SMS configuration for a phone number.
    • setTwoWay

      @Stability(Stable) public void setTwoWay(@Nullable IResolvable value)
      Describes the two-way SMS configuration for a phone number.
    • setTwoWay

      @Stability(Stable) public void setTwoWay(@Nullable CfnPhoneNumber.TwoWayProperty value)
      Describes the two-way SMS configuration for a phone number.