github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/sns/smsPreferences.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package sns 5 6 import ( 7 "context" 8 "reflect" 9 10 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Provides a way to set SNS SMS preferences. 15 // 16 // ## Example Usage 17 // 18 // <!--Start PulumiCodeChooser --> 19 // ```go 20 // package main 21 // 22 // import ( 23 // 24 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sns" 25 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 26 // 27 // ) 28 // 29 // func main() { 30 // pulumi.Run(func(ctx *pulumi.Context) error { 31 // _, err := sns.NewSmsPreferences(ctx, "update_sms_prefs", nil) 32 // if err != nil { 33 // return err 34 // } 35 // return nil 36 // }) 37 // } 38 // 39 // ``` 40 // <!--End PulumiCodeChooser --> 41 // 42 // ## Import 43 // 44 // You cannot import the SMS preferences. 45 type SmsPreferences struct { 46 pulumi.CustomResourceState 47 48 // A string, such as your business brand, that is displayed as the sender on the receiving device. 49 DefaultSenderId pulumi.StringPtrOutput `pulumi:"defaultSenderId"` 50 // The type of SMS message that you will send by default. Possible values are: Promotional, Transactional 51 DefaultSmsType pulumi.StringPtrOutput `pulumi:"defaultSmsType"` 52 // The ARN of the IAM role that allows Amazon SNS to write logs about SMS deliveries in CloudWatch Logs. 53 DeliveryStatusIamRoleArn pulumi.StringPtrOutput `pulumi:"deliveryStatusIamRoleArn"` 54 // The percentage of successful SMS deliveries for which Amazon SNS will write logs in CloudWatch Logs. The value must be between 0 and 100. 55 DeliveryStatusSuccessSamplingRate pulumi.StringPtrOutput `pulumi:"deliveryStatusSuccessSamplingRate"` 56 // The maximum amount in USD that you are willing to spend each month to send SMS messages. 57 MonthlySpendLimit pulumi.IntOutput `pulumi:"monthlySpendLimit"` 58 // The name of the Amazon S3 bucket to receive daily SMS usage reports from Amazon SNS. 59 UsageReportS3Bucket pulumi.StringPtrOutput `pulumi:"usageReportS3Bucket"` 60 } 61 62 // NewSmsPreferences registers a new resource with the given unique name, arguments, and options. 63 func NewSmsPreferences(ctx *pulumi.Context, 64 name string, args *SmsPreferencesArgs, opts ...pulumi.ResourceOption) (*SmsPreferences, error) { 65 if args == nil { 66 args = &SmsPreferencesArgs{} 67 } 68 69 opts = internal.PkgResourceDefaultOpts(opts) 70 var resource SmsPreferences 71 err := ctx.RegisterResource("aws:sns/smsPreferences:SmsPreferences", name, args, &resource, opts...) 72 if err != nil { 73 return nil, err 74 } 75 return &resource, nil 76 } 77 78 // GetSmsPreferences gets an existing SmsPreferences resource's state with the given name, ID, and optional 79 // state properties that are used to uniquely qualify the lookup (nil if not required). 80 func GetSmsPreferences(ctx *pulumi.Context, 81 name string, id pulumi.IDInput, state *SmsPreferencesState, opts ...pulumi.ResourceOption) (*SmsPreferences, error) { 82 var resource SmsPreferences 83 err := ctx.ReadResource("aws:sns/smsPreferences:SmsPreferences", name, id, state, &resource, opts...) 84 if err != nil { 85 return nil, err 86 } 87 return &resource, nil 88 } 89 90 // Input properties used for looking up and filtering SmsPreferences resources. 91 type smsPreferencesState struct { 92 // A string, such as your business brand, that is displayed as the sender on the receiving device. 93 DefaultSenderId *string `pulumi:"defaultSenderId"` 94 // The type of SMS message that you will send by default. Possible values are: Promotional, Transactional 95 DefaultSmsType *string `pulumi:"defaultSmsType"` 96 // The ARN of the IAM role that allows Amazon SNS to write logs about SMS deliveries in CloudWatch Logs. 97 DeliveryStatusIamRoleArn *string `pulumi:"deliveryStatusIamRoleArn"` 98 // The percentage of successful SMS deliveries for which Amazon SNS will write logs in CloudWatch Logs. The value must be between 0 and 100. 99 DeliveryStatusSuccessSamplingRate *string `pulumi:"deliveryStatusSuccessSamplingRate"` 100 // The maximum amount in USD that you are willing to spend each month to send SMS messages. 101 MonthlySpendLimit *int `pulumi:"monthlySpendLimit"` 102 // The name of the Amazon S3 bucket to receive daily SMS usage reports from Amazon SNS. 103 UsageReportS3Bucket *string `pulumi:"usageReportS3Bucket"` 104 } 105 106 type SmsPreferencesState struct { 107 // A string, such as your business brand, that is displayed as the sender on the receiving device. 108 DefaultSenderId pulumi.StringPtrInput 109 // The type of SMS message that you will send by default. Possible values are: Promotional, Transactional 110 DefaultSmsType pulumi.StringPtrInput 111 // The ARN of the IAM role that allows Amazon SNS to write logs about SMS deliveries in CloudWatch Logs. 112 DeliveryStatusIamRoleArn pulumi.StringPtrInput 113 // The percentage of successful SMS deliveries for which Amazon SNS will write logs in CloudWatch Logs. The value must be between 0 and 100. 114 DeliveryStatusSuccessSamplingRate pulumi.StringPtrInput 115 // The maximum amount in USD that you are willing to spend each month to send SMS messages. 116 MonthlySpendLimit pulumi.IntPtrInput 117 // The name of the Amazon S3 bucket to receive daily SMS usage reports from Amazon SNS. 118 UsageReportS3Bucket pulumi.StringPtrInput 119 } 120 121 func (SmsPreferencesState) ElementType() reflect.Type { 122 return reflect.TypeOf((*smsPreferencesState)(nil)).Elem() 123 } 124 125 type smsPreferencesArgs struct { 126 // A string, such as your business brand, that is displayed as the sender on the receiving device. 127 DefaultSenderId *string `pulumi:"defaultSenderId"` 128 // The type of SMS message that you will send by default. Possible values are: Promotional, Transactional 129 DefaultSmsType *string `pulumi:"defaultSmsType"` 130 // The ARN of the IAM role that allows Amazon SNS to write logs about SMS deliveries in CloudWatch Logs. 131 DeliveryStatusIamRoleArn *string `pulumi:"deliveryStatusIamRoleArn"` 132 // The percentage of successful SMS deliveries for which Amazon SNS will write logs in CloudWatch Logs. The value must be between 0 and 100. 133 DeliveryStatusSuccessSamplingRate *string `pulumi:"deliveryStatusSuccessSamplingRate"` 134 // The maximum amount in USD that you are willing to spend each month to send SMS messages. 135 MonthlySpendLimit *int `pulumi:"monthlySpendLimit"` 136 // The name of the Amazon S3 bucket to receive daily SMS usage reports from Amazon SNS. 137 UsageReportS3Bucket *string `pulumi:"usageReportS3Bucket"` 138 } 139 140 // The set of arguments for constructing a SmsPreferences resource. 141 type SmsPreferencesArgs struct { 142 // A string, such as your business brand, that is displayed as the sender on the receiving device. 143 DefaultSenderId pulumi.StringPtrInput 144 // The type of SMS message that you will send by default. Possible values are: Promotional, Transactional 145 DefaultSmsType pulumi.StringPtrInput 146 // The ARN of the IAM role that allows Amazon SNS to write logs about SMS deliveries in CloudWatch Logs. 147 DeliveryStatusIamRoleArn pulumi.StringPtrInput 148 // The percentage of successful SMS deliveries for which Amazon SNS will write logs in CloudWatch Logs. The value must be between 0 and 100. 149 DeliveryStatusSuccessSamplingRate pulumi.StringPtrInput 150 // The maximum amount in USD that you are willing to spend each month to send SMS messages. 151 MonthlySpendLimit pulumi.IntPtrInput 152 // The name of the Amazon S3 bucket to receive daily SMS usage reports from Amazon SNS. 153 UsageReportS3Bucket pulumi.StringPtrInput 154 } 155 156 func (SmsPreferencesArgs) ElementType() reflect.Type { 157 return reflect.TypeOf((*smsPreferencesArgs)(nil)).Elem() 158 } 159 160 type SmsPreferencesInput interface { 161 pulumi.Input 162 163 ToSmsPreferencesOutput() SmsPreferencesOutput 164 ToSmsPreferencesOutputWithContext(ctx context.Context) SmsPreferencesOutput 165 } 166 167 func (*SmsPreferences) ElementType() reflect.Type { 168 return reflect.TypeOf((**SmsPreferences)(nil)).Elem() 169 } 170 171 func (i *SmsPreferences) ToSmsPreferencesOutput() SmsPreferencesOutput { 172 return i.ToSmsPreferencesOutputWithContext(context.Background()) 173 } 174 175 func (i *SmsPreferences) ToSmsPreferencesOutputWithContext(ctx context.Context) SmsPreferencesOutput { 176 return pulumi.ToOutputWithContext(ctx, i).(SmsPreferencesOutput) 177 } 178 179 // SmsPreferencesArrayInput is an input type that accepts SmsPreferencesArray and SmsPreferencesArrayOutput values. 180 // You can construct a concrete instance of `SmsPreferencesArrayInput` via: 181 // 182 // SmsPreferencesArray{ SmsPreferencesArgs{...} } 183 type SmsPreferencesArrayInput interface { 184 pulumi.Input 185 186 ToSmsPreferencesArrayOutput() SmsPreferencesArrayOutput 187 ToSmsPreferencesArrayOutputWithContext(context.Context) SmsPreferencesArrayOutput 188 } 189 190 type SmsPreferencesArray []SmsPreferencesInput 191 192 func (SmsPreferencesArray) ElementType() reflect.Type { 193 return reflect.TypeOf((*[]*SmsPreferences)(nil)).Elem() 194 } 195 196 func (i SmsPreferencesArray) ToSmsPreferencesArrayOutput() SmsPreferencesArrayOutput { 197 return i.ToSmsPreferencesArrayOutputWithContext(context.Background()) 198 } 199 200 func (i SmsPreferencesArray) ToSmsPreferencesArrayOutputWithContext(ctx context.Context) SmsPreferencesArrayOutput { 201 return pulumi.ToOutputWithContext(ctx, i).(SmsPreferencesArrayOutput) 202 } 203 204 // SmsPreferencesMapInput is an input type that accepts SmsPreferencesMap and SmsPreferencesMapOutput values. 205 // You can construct a concrete instance of `SmsPreferencesMapInput` via: 206 // 207 // SmsPreferencesMap{ "key": SmsPreferencesArgs{...} } 208 type SmsPreferencesMapInput interface { 209 pulumi.Input 210 211 ToSmsPreferencesMapOutput() SmsPreferencesMapOutput 212 ToSmsPreferencesMapOutputWithContext(context.Context) SmsPreferencesMapOutput 213 } 214 215 type SmsPreferencesMap map[string]SmsPreferencesInput 216 217 func (SmsPreferencesMap) ElementType() reflect.Type { 218 return reflect.TypeOf((*map[string]*SmsPreferences)(nil)).Elem() 219 } 220 221 func (i SmsPreferencesMap) ToSmsPreferencesMapOutput() SmsPreferencesMapOutput { 222 return i.ToSmsPreferencesMapOutputWithContext(context.Background()) 223 } 224 225 func (i SmsPreferencesMap) ToSmsPreferencesMapOutputWithContext(ctx context.Context) SmsPreferencesMapOutput { 226 return pulumi.ToOutputWithContext(ctx, i).(SmsPreferencesMapOutput) 227 } 228 229 type SmsPreferencesOutput struct{ *pulumi.OutputState } 230 231 func (SmsPreferencesOutput) ElementType() reflect.Type { 232 return reflect.TypeOf((**SmsPreferences)(nil)).Elem() 233 } 234 235 func (o SmsPreferencesOutput) ToSmsPreferencesOutput() SmsPreferencesOutput { 236 return o 237 } 238 239 func (o SmsPreferencesOutput) ToSmsPreferencesOutputWithContext(ctx context.Context) SmsPreferencesOutput { 240 return o 241 } 242 243 // A string, such as your business brand, that is displayed as the sender on the receiving device. 244 func (o SmsPreferencesOutput) DefaultSenderId() pulumi.StringPtrOutput { 245 return o.ApplyT(func(v *SmsPreferences) pulumi.StringPtrOutput { return v.DefaultSenderId }).(pulumi.StringPtrOutput) 246 } 247 248 // The type of SMS message that you will send by default. Possible values are: Promotional, Transactional 249 func (o SmsPreferencesOutput) DefaultSmsType() pulumi.StringPtrOutput { 250 return o.ApplyT(func(v *SmsPreferences) pulumi.StringPtrOutput { return v.DefaultSmsType }).(pulumi.StringPtrOutput) 251 } 252 253 // The ARN of the IAM role that allows Amazon SNS to write logs about SMS deliveries in CloudWatch Logs. 254 func (o SmsPreferencesOutput) DeliveryStatusIamRoleArn() pulumi.StringPtrOutput { 255 return o.ApplyT(func(v *SmsPreferences) pulumi.StringPtrOutput { return v.DeliveryStatusIamRoleArn }).(pulumi.StringPtrOutput) 256 } 257 258 // The percentage of successful SMS deliveries for which Amazon SNS will write logs in CloudWatch Logs. The value must be between 0 and 100. 259 func (o SmsPreferencesOutput) DeliveryStatusSuccessSamplingRate() pulumi.StringPtrOutput { 260 return o.ApplyT(func(v *SmsPreferences) pulumi.StringPtrOutput { return v.DeliveryStatusSuccessSamplingRate }).(pulumi.StringPtrOutput) 261 } 262 263 // The maximum amount in USD that you are willing to spend each month to send SMS messages. 264 func (o SmsPreferencesOutput) MonthlySpendLimit() pulumi.IntOutput { 265 return o.ApplyT(func(v *SmsPreferences) pulumi.IntOutput { return v.MonthlySpendLimit }).(pulumi.IntOutput) 266 } 267 268 // The name of the Amazon S3 bucket to receive daily SMS usage reports from Amazon SNS. 269 func (o SmsPreferencesOutput) UsageReportS3Bucket() pulumi.StringPtrOutput { 270 return o.ApplyT(func(v *SmsPreferences) pulumi.StringPtrOutput { return v.UsageReportS3Bucket }).(pulumi.StringPtrOutput) 271 } 272 273 type SmsPreferencesArrayOutput struct{ *pulumi.OutputState } 274 275 func (SmsPreferencesArrayOutput) ElementType() reflect.Type { 276 return reflect.TypeOf((*[]*SmsPreferences)(nil)).Elem() 277 } 278 279 func (o SmsPreferencesArrayOutput) ToSmsPreferencesArrayOutput() SmsPreferencesArrayOutput { 280 return o 281 } 282 283 func (o SmsPreferencesArrayOutput) ToSmsPreferencesArrayOutputWithContext(ctx context.Context) SmsPreferencesArrayOutput { 284 return o 285 } 286 287 func (o SmsPreferencesArrayOutput) Index(i pulumi.IntInput) SmsPreferencesOutput { 288 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SmsPreferences { 289 return vs[0].([]*SmsPreferences)[vs[1].(int)] 290 }).(SmsPreferencesOutput) 291 } 292 293 type SmsPreferencesMapOutput struct{ *pulumi.OutputState } 294 295 func (SmsPreferencesMapOutput) ElementType() reflect.Type { 296 return reflect.TypeOf((*map[string]*SmsPreferences)(nil)).Elem() 297 } 298 299 func (o SmsPreferencesMapOutput) ToSmsPreferencesMapOutput() SmsPreferencesMapOutput { 300 return o 301 } 302 303 func (o SmsPreferencesMapOutput) ToSmsPreferencesMapOutputWithContext(ctx context.Context) SmsPreferencesMapOutput { 304 return o 305 } 306 307 func (o SmsPreferencesMapOutput) MapIndex(k pulumi.StringInput) SmsPreferencesOutput { 308 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SmsPreferences { 309 return vs[0].(map[string]*SmsPreferences)[vs[1].(string)] 310 }).(SmsPreferencesOutput) 311 } 312 313 func init() { 314 pulumi.RegisterInputType(reflect.TypeOf((*SmsPreferencesInput)(nil)).Elem(), &SmsPreferences{}) 315 pulumi.RegisterInputType(reflect.TypeOf((*SmsPreferencesArrayInput)(nil)).Elem(), SmsPreferencesArray{}) 316 pulumi.RegisterInputType(reflect.TypeOf((*SmsPreferencesMapInput)(nil)).Elem(), SmsPreferencesMap{}) 317 pulumi.RegisterOutputType(SmsPreferencesOutput{}) 318 pulumi.RegisterOutputType(SmsPreferencesArrayOutput{}) 319 pulumi.RegisterOutputType(SmsPreferencesMapOutput{}) 320 }