hsdp.IamSmsTemplate
Explore with Pulumi AI
This resource allows you to provision and manage custom SMS template types for an organization. The SMS templates can be registered for different locales as well.
Types of templates
The various template types supported by IAM are:
Type | Description |
---|---|
PHONE_VERIFICATION | Send when the users’ phone needs to be verified |
PASSWORD_RECOVERY | If a user triggers forgot password flow, OTP to reset password will be sent to user. The following placeholders are supported in this template |
PASSWORD_FAILED_ATTEMPTS | If there are multiple attempts to change user account password with invalid current password, then the user will get this SMS notification warning user about malicious login attempts. This notification will be sent after 5 invalid attempts. The following placeholders are supported in this template |
MFA_OTP | This SMS template is used for login using OTP for multi-fator authentication. |
Placeholders
SMS template supports adding certain placeholders in message body based on template type specified. This allows client to templatize certain parts of SMS template with dynamic data based on whom the SMS is targeted.
All template types support the following place holders in message
{{user.userName}}
- Unique login ID of the user{{user.givenName}}
- User’s first name{{user.familyName}}
- User’s last name{{user.displayName}}
- User’s display name
PHONE_VERIFICATION
The following placeholders are supported in this template
{{template.otp}}
- Generated OTP.{{template.otpExpiryPeriod}}
- How long the OTP is valid (in minutes){{template.phoneNumber}}
- Phone number for verification.
PASSWORD_RECOVERY
If a user triggers forgot password flow, OTP to reset password will be sent to user. The following placeholders are supported in this template
{{template.otp}}
- Generated OTP.{{template.otpExpiryPeriod}}
- How long the OTP is valid (in minutes){{template.phoneNumber}}
- Phone number for verification.
PASSWORD_FAILED_ATTEMPTS
If there are multiple attempts to change user account password with invalid current password, then the user will get this SMS notification warning user about malicious login attempts. This notification will be sent after 5 invalid attempts. The following placeholders are supported in this template
{{user.lockoutPeriod}}
- How long the account will be in locked state (in minutes)
MFA_OTP
This SMS template is used for login using OTP for multi-fator authentication. The following placeholders are supported in this template
{{template.otp}}
- Generated OTP.{{template.otpExpiryPeriod}}
- How long the OTP is valid (in minutes)
Example Usage
The following example manages an email template for an org
import * as pulumi from "@pulumi/pulumi";
import * as hsdp from "@pulumi/hsdp";
const mfaOtpDefault = new hsdp.IamSmsTemplate("mfaOtpDefault", {
type: "MFA_OTP",
organizationId: _var.org_id,
message: "Hi {{user.givenName}}, your OTP code is {{template.otp}}, valid for {{template.otpExpiryPeriod}} minutes",
});
const mfaOtpNl = new hsdp.IamSmsTemplate("mfaOtpNl", {
type: "MFA_OTP",
organizationId: _var.org_id,
message: "Hallo {{user.givenName}}, jouw OTP code is {{template.otp}}, deze is {{template.otpExpiryPeriod}} minuten geldig",
locale: "nl-NL",
});
import pulumi
import pulumi_hsdp as hsdp
mfa_otp_default = hsdp.IamSmsTemplate("mfaOtpDefault",
type="MFA_OTP",
organization_id=var["org_id"],
message="Hi {{user.givenName}}, your OTP code is {{template.otp}}, valid for {{template.otpExpiryPeriod}} minutes")
mfa_otp_nl = hsdp.IamSmsTemplate("mfaOtpNl",
type="MFA_OTP",
organization_id=var["org_id"],
message="Hallo {{user.givenName}}, jouw OTP code is {{template.otp}}, deze is {{template.otpExpiryPeriod}} minuten geldig",
locale="nl-NL")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/hsdp/hsdp"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := hsdp.NewIamSmsTemplate(ctx, "mfaOtpDefault", &hsdp.IamSmsTemplateArgs{
Type: pulumi.String("MFA_OTP"),
OrganizationId: pulumi.Any(_var.Org_id),
Message: pulumi.String("Hi {{user.givenName}}, your OTP code is {{template.otp}}, valid for {{template.otpExpiryPeriod}} minutes"),
})
if err != nil {
return err
}
_, err = hsdp.NewIamSmsTemplate(ctx, "mfaOtpNl", &hsdp.IamSmsTemplateArgs{
Type: pulumi.String("MFA_OTP"),
OrganizationId: pulumi.Any(_var.Org_id),
Message: pulumi.String("Hallo {{user.givenName}}, jouw OTP code is {{template.otp}}, deze is {{template.otpExpiryPeriod}} minuten geldig"),
Locale: pulumi.String("nl-NL"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Hsdp = Pulumi.Hsdp;
return await Deployment.RunAsync(() =>
{
var mfaOtpDefault = new Hsdp.IamSmsTemplate("mfaOtpDefault", new()
{
Type = "MFA_OTP",
OrganizationId = @var.Org_id,
Message = "Hi {{user.givenName}}, your OTP code is {{template.otp}}, valid for {{template.otpExpiryPeriod}} minutes",
});
var mfaOtpNl = new Hsdp.IamSmsTemplate("mfaOtpNl", new()
{
Type = "MFA_OTP",
OrganizationId = @var.Org_id,
Message = "Hallo {{user.givenName}}, jouw OTP code is {{template.otp}}, deze is {{template.otpExpiryPeriod}} minuten geldig",
Locale = "nl-NL",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.hsdp.IamSmsTemplate;
import com.pulumi.hsdp.IamSmsTemplateArgs;
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 mfaOtpDefault = new IamSmsTemplate("mfaOtpDefault", IamSmsTemplateArgs.builder()
.type("MFA_OTP")
.organizationId(var_.org_id())
.message("Hi {{user.givenName}}, your OTP code is {{template.otp}}, valid for {{template.otpExpiryPeriod}} minutes")
.build());
var mfaOtpNl = new IamSmsTemplate("mfaOtpNl", IamSmsTemplateArgs.builder()
.type("MFA_OTP")
.organizationId(var_.org_id())
.message("Hallo {{user.givenName}}, jouw OTP code is {{template.otp}}, deze is {{template.otpExpiryPeriod}} minuten geldig")
.locale("nl-NL")
.build());
}
}
resources:
mfaOtpDefault:
type: hsdp:IamSmsTemplate
properties:
type: MFA_OTP
organizationId: ${var.org_id}
message: Hi {{user.givenName}}, your OTP code is {{template.otp}}, valid for {{template.otpExpiryPeriod}} minutes
mfaOtpNl:
type: hsdp:IamSmsTemplate
properties:
type: MFA_OTP
organizationId: ${var.org_id}
message: Hallo {{user.givenName}}, jouw OTP code is {{template.otp}}, deze is {{template.otpExpiryPeriod}} minuten geldig
locale: nl-NL
Create IamSmsTemplate Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new IamSmsTemplate(name: string, args: IamSmsTemplateArgs, opts?: CustomResourceOptions);
@overload
def IamSmsTemplate(resource_name: str,
args: IamSmsTemplateArgs,
opts: Optional[ResourceOptions] = None)
@overload
def IamSmsTemplate(resource_name: str,
opts: Optional[ResourceOptions] = None,
message: Optional[str] = None,
organization_id: Optional[str] = None,
type: Optional[str] = None,
external_id: Optional[str] = None,
iam_sms_template_id: Optional[str] = None,
locale: Optional[str] = None)
func NewIamSmsTemplate(ctx *Context, name string, args IamSmsTemplateArgs, opts ...ResourceOption) (*IamSmsTemplate, error)
public IamSmsTemplate(string name, IamSmsTemplateArgs args, CustomResourceOptions? opts = null)
public IamSmsTemplate(String name, IamSmsTemplateArgs args)
public IamSmsTemplate(String name, IamSmsTemplateArgs args, CustomResourceOptions options)
type: hsdp:IamSmsTemplate
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 IamSmsTemplateArgs
- 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 IamSmsTemplateArgs
- 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 IamSmsTemplateArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args IamSmsTemplateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args IamSmsTemplateArgs
- 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 iamSmsTemplateResource = new Hsdp.IamSmsTemplate("iamSmsTemplateResource", new()
{
Message = "string",
OrganizationId = "string",
Type = "string",
ExternalId = "string",
IamSmsTemplateId = "string",
Locale = "string",
});
example, err := hsdp.NewIamSmsTemplate(ctx, "iamSmsTemplateResource", &hsdp.IamSmsTemplateArgs{
Message: pulumi.String("string"),
OrganizationId: pulumi.String("string"),
Type: pulumi.String("string"),
ExternalId: pulumi.String("string"),
IamSmsTemplateId: pulumi.String("string"),
Locale: pulumi.String("string"),
})
var iamSmsTemplateResource = new IamSmsTemplate("iamSmsTemplateResource", IamSmsTemplateArgs.builder()
.message("string")
.organizationId("string")
.type("string")
.externalId("string")
.iamSmsTemplateId("string")
.locale("string")
.build());
iam_sms_template_resource = hsdp.IamSmsTemplate("iamSmsTemplateResource",
message="string",
organization_id="string",
type="string",
external_id="string",
iam_sms_template_id="string",
locale="string")
const iamSmsTemplateResource = new hsdp.IamSmsTemplate("iamSmsTemplateResource", {
message: "string",
organizationId: "string",
type: "string",
externalId: "string",
iamSmsTemplateId: "string",
locale: "string",
});
type: hsdp:IamSmsTemplate
properties:
externalId: string
iamSmsTemplateId: string
locale: string
message: string
organizationId: string
type: string
IamSmsTemplate 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 IamSmsTemplate resource accepts the following input properties:
- Message string
- The message, including template placeholders. Max length is 160 chars. Take into account placeholder expansion
- Organization
Id string - The UUID of the IAM Org to apply this SMS template to
- Type string
- The SMS template type. See the
Type
table above for available values - External
Id string - Iam
Sms stringTemplate Id - The GUID of the email template
- Locale string
- The locale of the template. When not specified the template will become the default. Only a single default template is allowed of course.
- Message string
- The message, including template placeholders. Max length is 160 chars. Take into account placeholder expansion
- Organization
Id string - The UUID of the IAM Org to apply this SMS template to
- Type string
- The SMS template type. See the
Type
table above for available values - External
Id string - Iam
Sms stringTemplate Id - The GUID of the email template
- Locale string
- The locale of the template. When not specified the template will become the default. Only a single default template is allowed of course.
- message String
- The message, including template placeholders. Max length is 160 chars. Take into account placeholder expansion
- organization
Id String - The UUID of the IAM Org to apply this SMS template to
- type String
- The SMS template type. See the
Type
table above for available values - external
Id String - iam
Sms StringTemplate Id - The GUID of the email template
- locale String
- The locale of the template. When not specified the template will become the default. Only a single default template is allowed of course.
- message string
- The message, including template placeholders. Max length is 160 chars. Take into account placeholder expansion
- organization
Id string - The UUID of the IAM Org to apply this SMS template to
- type string
- The SMS template type. See the
Type
table above for available values - external
Id string - iam
Sms stringTemplate Id - The GUID of the email template
- locale string
- The locale of the template. When not specified the template will become the default. Only a single default template is allowed of course.
- message str
- The message, including template placeholders. Max length is 160 chars. Take into account placeholder expansion
- organization_
id str - The UUID of the IAM Org to apply this SMS template to
- type str
- The SMS template type. See the
Type
table above for available values - external_
id str - iam_
sms_ strtemplate_ id - The GUID of the email template
- locale str
- The locale of the template. When not specified the template will become the default. Only a single default template is allowed of course.
- message String
- The message, including template placeholders. Max length is 160 chars. Take into account placeholder expansion
- organization
Id String - The UUID of the IAM Org to apply this SMS template to
- type String
- The SMS template type. See the
Type
table above for available values - external
Id String - iam
Sms StringTemplate Id - The GUID of the email template
- locale String
- The locale of the template. When not specified the template will become the default. Only a single default template is allowed of course.
Outputs
All input properties are implicitly available as output properties. Additionally, the IamSmsTemplate resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing IamSmsTemplate Resource
Get an existing IamSmsTemplate 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?: IamSmsTemplateState, opts?: CustomResourceOptions): IamSmsTemplate
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
external_id: Optional[str] = None,
iam_sms_template_id: Optional[str] = None,
locale: Optional[str] = None,
message: Optional[str] = None,
organization_id: Optional[str] = None,
type: Optional[str] = None) -> IamSmsTemplate
func GetIamSmsTemplate(ctx *Context, name string, id IDInput, state *IamSmsTemplateState, opts ...ResourceOption) (*IamSmsTemplate, error)
public static IamSmsTemplate Get(string name, Input<string> id, IamSmsTemplateState? state, CustomResourceOptions? opts = null)
public static IamSmsTemplate get(String name, Output<String> id, IamSmsTemplateState state, CustomResourceOptions options)
resources: _: type: hsdp:IamSmsTemplate get: id: ${id}
- 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.
- External
Id string - Iam
Sms stringTemplate Id - The GUID of the email template
- Locale string
- The locale of the template. When not specified the template will become the default. Only a single default template is allowed of course.
- Message string
- The message, including template placeholders. Max length is 160 chars. Take into account placeholder expansion
- Organization
Id string - The UUID of the IAM Org to apply this SMS template to
- Type string
- The SMS template type. See the
Type
table above for available values
- External
Id string - Iam
Sms stringTemplate Id - The GUID of the email template
- Locale string
- The locale of the template. When not specified the template will become the default. Only a single default template is allowed of course.
- Message string
- The message, including template placeholders. Max length is 160 chars. Take into account placeholder expansion
- Organization
Id string - The UUID of the IAM Org to apply this SMS template to
- Type string
- The SMS template type. See the
Type
table above for available values
- external
Id String - iam
Sms StringTemplate Id - The GUID of the email template
- locale String
- The locale of the template. When not specified the template will become the default. Only a single default template is allowed of course.
- message String
- The message, including template placeholders. Max length is 160 chars. Take into account placeholder expansion
- organization
Id String - The UUID of the IAM Org to apply this SMS template to
- type String
- The SMS template type. See the
Type
table above for available values
- external
Id string - iam
Sms stringTemplate Id - The GUID of the email template
- locale string
- The locale of the template. When not specified the template will become the default. Only a single default template is allowed of course.
- message string
- The message, including template placeholders. Max length is 160 chars. Take into account placeholder expansion
- organization
Id string - The UUID of the IAM Org to apply this SMS template to
- type string
- The SMS template type. See the
Type
table above for available values
- external_
id str - iam_
sms_ strtemplate_ id - The GUID of the email template
- locale str
- The locale of the template. When not specified the template will become the default. Only a single default template is allowed of course.
- message str
- The message, including template placeholders. Max length is 160 chars. Take into account placeholder expansion
- organization_
id str - The UUID of the IAM Org to apply this SMS template to
- type str
- The SMS template type. See the
Type
table above for available values
- external
Id String - iam
Sms StringTemplate Id - The GUID of the email template
- locale String
- The locale of the template. When not specified the template will become the default. Only a single default template is allowed of course.
- message String
- The message, including template placeholders. Max length is 160 chars. Take into account placeholder expansion
- organization
Id String - The UUID of the IAM Org to apply this SMS template to
- type String
- The SMS template type. See the
Type
table above for available values
Import
Importing is supported but not recommended as the message
body is not returned when reading out a template via the IAM API
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- hsdp philips-software/terraform-provider-hsdp
- License
- Notes
- This Pulumi package is based on the
hsdp
Terraform Provider.