github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/chime/voiceConnector.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 chime
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"errors"
    11  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // Enables you to connect your phone system to the telephone network at a substantial cost savings by using SIP trunking.
    16  //
    17  // ## Example Usage
    18  //
    19  // <!--Start PulumiCodeChooser -->
    20  // ```go
    21  // package main
    22  //
    23  // import (
    24  //
    25  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/chime"
    26  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    27  //
    28  // )
    29  //
    30  //	func main() {
    31  //		pulumi.Run(func(ctx *pulumi.Context) error {
    32  //			_, err := chime.NewVoiceConnector(ctx, "test", &chime.VoiceConnectorArgs{
    33  //				Name:              pulumi.String("connector-test-1"),
    34  //				RequireEncryption: pulumi.Bool(true),
    35  //				AwsRegion:         pulumi.String("us-east-1"),
    36  //			})
    37  //			if err != nil {
    38  //				return err
    39  //			}
    40  //			return nil
    41  //		})
    42  //	}
    43  //
    44  // ```
    45  // <!--End PulumiCodeChooser -->
    46  //
    47  // ## Import
    48  //
    49  // Using `pulumi import`, import Configuration Recorder using the name. For example:
    50  //
    51  // ```sh
    52  // $ pulumi import aws:chime/voiceConnector:VoiceConnector test example
    53  // ```
    54  type VoiceConnector struct {
    55  	pulumi.CustomResourceState
    56  
    57  	// ARN (Amazon Resource Name) of the Amazon Chime Voice Connector.
    58  	Arn pulumi.StringOutput `pulumi:"arn"`
    59  	// The AWS Region in which the Amazon Chime Voice Connector is created. Default value: `us-east-1`
    60  	AwsRegion pulumi.StringOutput `pulumi:"awsRegion"`
    61  	// The name of the Amazon Chime Voice Connector.
    62  	Name pulumi.StringOutput `pulumi:"name"`
    63  	// The outbound host name for the Amazon Chime Voice Connector.
    64  	OutboundHostName pulumi.StringOutput `pulumi:"outboundHostName"`
    65  	// When enabled, requires encryption for the Amazon Chime Voice Connector.
    66  	//
    67  	// The following arguments are optional:
    68  	RequireEncryption pulumi.BoolOutput `pulumi:"requireEncryption"`
    69  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    70  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    71  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    72  	//
    73  	// Deprecated: Please use `tags` instead.
    74  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    75  }
    76  
    77  // NewVoiceConnector registers a new resource with the given unique name, arguments, and options.
    78  func NewVoiceConnector(ctx *pulumi.Context,
    79  	name string, args *VoiceConnectorArgs, opts ...pulumi.ResourceOption) (*VoiceConnector, error) {
    80  	if args == nil {
    81  		return nil, errors.New("missing one or more required arguments")
    82  	}
    83  
    84  	if args.RequireEncryption == nil {
    85  		return nil, errors.New("invalid value for required argument 'RequireEncryption'")
    86  	}
    87  	opts = internal.PkgResourceDefaultOpts(opts)
    88  	var resource VoiceConnector
    89  	err := ctx.RegisterResource("aws:chime/voiceConnector:VoiceConnector", name, args, &resource, opts...)
    90  	if err != nil {
    91  		return nil, err
    92  	}
    93  	return &resource, nil
    94  }
    95  
    96  // GetVoiceConnector gets an existing VoiceConnector resource's state with the given name, ID, and optional
    97  // state properties that are used to uniquely qualify the lookup (nil if not required).
    98  func GetVoiceConnector(ctx *pulumi.Context,
    99  	name string, id pulumi.IDInput, state *VoiceConnectorState, opts ...pulumi.ResourceOption) (*VoiceConnector, error) {
   100  	var resource VoiceConnector
   101  	err := ctx.ReadResource("aws:chime/voiceConnector:VoiceConnector", name, id, state, &resource, opts...)
   102  	if err != nil {
   103  		return nil, err
   104  	}
   105  	return &resource, nil
   106  }
   107  
   108  // Input properties used for looking up and filtering VoiceConnector resources.
   109  type voiceConnectorState struct {
   110  	// ARN (Amazon Resource Name) of the Amazon Chime Voice Connector.
   111  	Arn *string `pulumi:"arn"`
   112  	// The AWS Region in which the Amazon Chime Voice Connector is created. Default value: `us-east-1`
   113  	AwsRegion *string `pulumi:"awsRegion"`
   114  	// The name of the Amazon Chime Voice Connector.
   115  	Name *string `pulumi:"name"`
   116  	// The outbound host name for the Amazon Chime Voice Connector.
   117  	OutboundHostName *string `pulumi:"outboundHostName"`
   118  	// When enabled, requires encryption for the Amazon Chime Voice Connector.
   119  	//
   120  	// The following arguments are optional:
   121  	RequireEncryption *bool `pulumi:"requireEncryption"`
   122  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   123  	Tags map[string]string `pulumi:"tags"`
   124  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   125  	//
   126  	// Deprecated: Please use `tags` instead.
   127  	TagsAll map[string]string `pulumi:"tagsAll"`
   128  }
   129  
   130  type VoiceConnectorState struct {
   131  	// ARN (Amazon Resource Name) of the Amazon Chime Voice Connector.
   132  	Arn pulumi.StringPtrInput
   133  	// The AWS Region in which the Amazon Chime Voice Connector is created. Default value: `us-east-1`
   134  	AwsRegion pulumi.StringPtrInput
   135  	// The name of the Amazon Chime Voice Connector.
   136  	Name pulumi.StringPtrInput
   137  	// The outbound host name for the Amazon Chime Voice Connector.
   138  	OutboundHostName pulumi.StringPtrInput
   139  	// When enabled, requires encryption for the Amazon Chime Voice Connector.
   140  	//
   141  	// The following arguments are optional:
   142  	RequireEncryption pulumi.BoolPtrInput
   143  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   144  	Tags pulumi.StringMapInput
   145  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   146  	//
   147  	// Deprecated: Please use `tags` instead.
   148  	TagsAll pulumi.StringMapInput
   149  }
   150  
   151  func (VoiceConnectorState) ElementType() reflect.Type {
   152  	return reflect.TypeOf((*voiceConnectorState)(nil)).Elem()
   153  }
   154  
   155  type voiceConnectorArgs struct {
   156  	// The AWS Region in which the Amazon Chime Voice Connector is created. Default value: `us-east-1`
   157  	AwsRegion *string `pulumi:"awsRegion"`
   158  	// The name of the Amazon Chime Voice Connector.
   159  	Name *string `pulumi:"name"`
   160  	// When enabled, requires encryption for the Amazon Chime Voice Connector.
   161  	//
   162  	// The following arguments are optional:
   163  	RequireEncryption bool `pulumi:"requireEncryption"`
   164  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   165  	Tags map[string]string `pulumi:"tags"`
   166  }
   167  
   168  // The set of arguments for constructing a VoiceConnector resource.
   169  type VoiceConnectorArgs struct {
   170  	// The AWS Region in which the Amazon Chime Voice Connector is created. Default value: `us-east-1`
   171  	AwsRegion pulumi.StringPtrInput
   172  	// The name of the Amazon Chime Voice Connector.
   173  	Name pulumi.StringPtrInput
   174  	// When enabled, requires encryption for the Amazon Chime Voice Connector.
   175  	//
   176  	// The following arguments are optional:
   177  	RequireEncryption pulumi.BoolInput
   178  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   179  	Tags pulumi.StringMapInput
   180  }
   181  
   182  func (VoiceConnectorArgs) ElementType() reflect.Type {
   183  	return reflect.TypeOf((*voiceConnectorArgs)(nil)).Elem()
   184  }
   185  
   186  type VoiceConnectorInput interface {
   187  	pulumi.Input
   188  
   189  	ToVoiceConnectorOutput() VoiceConnectorOutput
   190  	ToVoiceConnectorOutputWithContext(ctx context.Context) VoiceConnectorOutput
   191  }
   192  
   193  func (*VoiceConnector) ElementType() reflect.Type {
   194  	return reflect.TypeOf((**VoiceConnector)(nil)).Elem()
   195  }
   196  
   197  func (i *VoiceConnector) ToVoiceConnectorOutput() VoiceConnectorOutput {
   198  	return i.ToVoiceConnectorOutputWithContext(context.Background())
   199  }
   200  
   201  func (i *VoiceConnector) ToVoiceConnectorOutputWithContext(ctx context.Context) VoiceConnectorOutput {
   202  	return pulumi.ToOutputWithContext(ctx, i).(VoiceConnectorOutput)
   203  }
   204  
   205  // VoiceConnectorArrayInput is an input type that accepts VoiceConnectorArray and VoiceConnectorArrayOutput values.
   206  // You can construct a concrete instance of `VoiceConnectorArrayInput` via:
   207  //
   208  //	VoiceConnectorArray{ VoiceConnectorArgs{...} }
   209  type VoiceConnectorArrayInput interface {
   210  	pulumi.Input
   211  
   212  	ToVoiceConnectorArrayOutput() VoiceConnectorArrayOutput
   213  	ToVoiceConnectorArrayOutputWithContext(context.Context) VoiceConnectorArrayOutput
   214  }
   215  
   216  type VoiceConnectorArray []VoiceConnectorInput
   217  
   218  func (VoiceConnectorArray) ElementType() reflect.Type {
   219  	return reflect.TypeOf((*[]*VoiceConnector)(nil)).Elem()
   220  }
   221  
   222  func (i VoiceConnectorArray) ToVoiceConnectorArrayOutput() VoiceConnectorArrayOutput {
   223  	return i.ToVoiceConnectorArrayOutputWithContext(context.Background())
   224  }
   225  
   226  func (i VoiceConnectorArray) ToVoiceConnectorArrayOutputWithContext(ctx context.Context) VoiceConnectorArrayOutput {
   227  	return pulumi.ToOutputWithContext(ctx, i).(VoiceConnectorArrayOutput)
   228  }
   229  
   230  // VoiceConnectorMapInput is an input type that accepts VoiceConnectorMap and VoiceConnectorMapOutput values.
   231  // You can construct a concrete instance of `VoiceConnectorMapInput` via:
   232  //
   233  //	VoiceConnectorMap{ "key": VoiceConnectorArgs{...} }
   234  type VoiceConnectorMapInput interface {
   235  	pulumi.Input
   236  
   237  	ToVoiceConnectorMapOutput() VoiceConnectorMapOutput
   238  	ToVoiceConnectorMapOutputWithContext(context.Context) VoiceConnectorMapOutput
   239  }
   240  
   241  type VoiceConnectorMap map[string]VoiceConnectorInput
   242  
   243  func (VoiceConnectorMap) ElementType() reflect.Type {
   244  	return reflect.TypeOf((*map[string]*VoiceConnector)(nil)).Elem()
   245  }
   246  
   247  func (i VoiceConnectorMap) ToVoiceConnectorMapOutput() VoiceConnectorMapOutput {
   248  	return i.ToVoiceConnectorMapOutputWithContext(context.Background())
   249  }
   250  
   251  func (i VoiceConnectorMap) ToVoiceConnectorMapOutputWithContext(ctx context.Context) VoiceConnectorMapOutput {
   252  	return pulumi.ToOutputWithContext(ctx, i).(VoiceConnectorMapOutput)
   253  }
   254  
   255  type VoiceConnectorOutput struct{ *pulumi.OutputState }
   256  
   257  func (VoiceConnectorOutput) ElementType() reflect.Type {
   258  	return reflect.TypeOf((**VoiceConnector)(nil)).Elem()
   259  }
   260  
   261  func (o VoiceConnectorOutput) ToVoiceConnectorOutput() VoiceConnectorOutput {
   262  	return o
   263  }
   264  
   265  func (o VoiceConnectorOutput) ToVoiceConnectorOutputWithContext(ctx context.Context) VoiceConnectorOutput {
   266  	return o
   267  }
   268  
   269  // ARN (Amazon Resource Name) of the Amazon Chime Voice Connector.
   270  func (o VoiceConnectorOutput) Arn() pulumi.StringOutput {
   271  	return o.ApplyT(func(v *VoiceConnector) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   272  }
   273  
   274  // The AWS Region in which the Amazon Chime Voice Connector is created. Default value: `us-east-1`
   275  func (o VoiceConnectorOutput) AwsRegion() pulumi.StringOutput {
   276  	return o.ApplyT(func(v *VoiceConnector) pulumi.StringOutput { return v.AwsRegion }).(pulumi.StringOutput)
   277  }
   278  
   279  // The name of the Amazon Chime Voice Connector.
   280  func (o VoiceConnectorOutput) Name() pulumi.StringOutput {
   281  	return o.ApplyT(func(v *VoiceConnector) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   282  }
   283  
   284  // The outbound host name for the Amazon Chime Voice Connector.
   285  func (o VoiceConnectorOutput) OutboundHostName() pulumi.StringOutput {
   286  	return o.ApplyT(func(v *VoiceConnector) pulumi.StringOutput { return v.OutboundHostName }).(pulumi.StringOutput)
   287  }
   288  
   289  // When enabled, requires encryption for the Amazon Chime Voice Connector.
   290  //
   291  // The following arguments are optional:
   292  func (o VoiceConnectorOutput) RequireEncryption() pulumi.BoolOutput {
   293  	return o.ApplyT(func(v *VoiceConnector) pulumi.BoolOutput { return v.RequireEncryption }).(pulumi.BoolOutput)
   294  }
   295  
   296  // Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   297  func (o VoiceConnectorOutput) Tags() pulumi.StringMapOutput {
   298  	return o.ApplyT(func(v *VoiceConnector) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   299  }
   300  
   301  // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   302  //
   303  // Deprecated: Please use `tags` instead.
   304  func (o VoiceConnectorOutput) TagsAll() pulumi.StringMapOutput {
   305  	return o.ApplyT(func(v *VoiceConnector) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   306  }
   307  
   308  type VoiceConnectorArrayOutput struct{ *pulumi.OutputState }
   309  
   310  func (VoiceConnectorArrayOutput) ElementType() reflect.Type {
   311  	return reflect.TypeOf((*[]*VoiceConnector)(nil)).Elem()
   312  }
   313  
   314  func (o VoiceConnectorArrayOutput) ToVoiceConnectorArrayOutput() VoiceConnectorArrayOutput {
   315  	return o
   316  }
   317  
   318  func (o VoiceConnectorArrayOutput) ToVoiceConnectorArrayOutputWithContext(ctx context.Context) VoiceConnectorArrayOutput {
   319  	return o
   320  }
   321  
   322  func (o VoiceConnectorArrayOutput) Index(i pulumi.IntInput) VoiceConnectorOutput {
   323  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *VoiceConnector {
   324  		return vs[0].([]*VoiceConnector)[vs[1].(int)]
   325  	}).(VoiceConnectorOutput)
   326  }
   327  
   328  type VoiceConnectorMapOutput struct{ *pulumi.OutputState }
   329  
   330  func (VoiceConnectorMapOutput) ElementType() reflect.Type {
   331  	return reflect.TypeOf((*map[string]*VoiceConnector)(nil)).Elem()
   332  }
   333  
   334  func (o VoiceConnectorMapOutput) ToVoiceConnectorMapOutput() VoiceConnectorMapOutput {
   335  	return o
   336  }
   337  
   338  func (o VoiceConnectorMapOutput) ToVoiceConnectorMapOutputWithContext(ctx context.Context) VoiceConnectorMapOutput {
   339  	return o
   340  }
   341  
   342  func (o VoiceConnectorMapOutput) MapIndex(k pulumi.StringInput) VoiceConnectorOutput {
   343  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *VoiceConnector {
   344  		return vs[0].(map[string]*VoiceConnector)[vs[1].(string)]
   345  	}).(VoiceConnectorOutput)
   346  }
   347  
   348  func init() {
   349  	pulumi.RegisterInputType(reflect.TypeOf((*VoiceConnectorInput)(nil)).Elem(), &VoiceConnector{})
   350  	pulumi.RegisterInputType(reflect.TypeOf((*VoiceConnectorArrayInput)(nil)).Elem(), VoiceConnectorArray{})
   351  	pulumi.RegisterInputType(reflect.TypeOf((*VoiceConnectorMapInput)(nil)).Elem(), VoiceConnectorMap{})
   352  	pulumi.RegisterOutputType(VoiceConnectorOutput{})
   353  	pulumi.RegisterOutputType(VoiceConnectorArrayOutput{})
   354  	pulumi.RegisterOutputType(VoiceConnectorMapOutput{})
   355  }