github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/globalaccelerator/accelerator.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 globalaccelerator
     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  // Creates a Global Accelerator accelerator.
    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/globalaccelerator"
    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 := globalaccelerator.NewAccelerator(ctx, "example", &globalaccelerator.AcceleratorArgs{
    32  //				Name:          pulumi.String("Example"),
    33  //				IpAddressType: pulumi.String("IPV4"),
    34  //				IpAddresses: pulumi.StringArray{
    35  //					pulumi.String("1.2.3.4"),
    36  //				},
    37  //				Enabled: pulumi.Bool(true),
    38  //				Attributes: &globalaccelerator.AcceleratorAttributesArgs{
    39  //					FlowLogsEnabled:  pulumi.Bool(true),
    40  //					FlowLogsS3Bucket: pulumi.String("example-bucket"),
    41  //					FlowLogsS3Prefix: pulumi.String("flow-logs/"),
    42  //				},
    43  //			})
    44  //			if err != nil {
    45  //				return err
    46  //			}
    47  //			return nil
    48  //		})
    49  //	}
    50  //
    51  // ```
    52  // <!--End PulumiCodeChooser -->
    53  //
    54  // ## Import
    55  //
    56  // Using `pulumi import`, import Global Accelerator accelerators using the `arn`. For example:
    57  //
    58  // ```sh
    59  // $ pulumi import aws:globalaccelerator/accelerator:Accelerator example arn:aws:globalaccelerator::111111111111:accelerator/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    60  // ```
    61  type Accelerator struct {
    62  	pulumi.CustomResourceState
    63  
    64  	// The attributes of the accelerator. Fields documented below.
    65  	Attributes AcceleratorAttributesPtrOutput `pulumi:"attributes"`
    66  	// The DNS name of the accelerator. For example, `a5d53ff5ee6bca4ce.awsglobalaccelerator.com`.
    67  	DnsName pulumi.StringOutput `pulumi:"dnsName"`
    68  	// The Domain Name System (DNS) name that Global Accelerator creates that points to a dual-stack accelerator's four static IP addresses: two IPv4 addresses and two IPv6 addresses. For example, `a1234567890abcdef.dualstack.awsglobalaccelerator.com`.
    69  	DualStackDnsName pulumi.StringOutput `pulumi:"dualStackDnsName"`
    70  	// Indicates whether the accelerator is enabled. Defaults to `true`. Valid values: `true`, `false`.
    71  	Enabled pulumi.BoolPtrOutput `pulumi:"enabled"`
    72  	// -  The Global Accelerator Route 53 zone ID that can be used to
    73  	//    route an [Alias Resource Record Set](https://docs.aws.amazon.com/Route53/latest/APIReference/API_AliasTarget.html) to the Global Accelerator. This attribute
    74  	//    is simply an alias for the zone ID `Z2BJ6XQ5FK7U4H`.
    75  	HostedZoneId pulumi.StringOutput `pulumi:"hostedZoneId"`
    76  	// The value for the address type. Defaults to `IPV4`. Valid values: `IPV4`, `DUAL_STACK`.
    77  	IpAddressType pulumi.StringPtrOutput `pulumi:"ipAddressType"`
    78  	// The IP addresses to use for BYOIP accelerators. If not specified, the service assigns IP addresses. Valid values: 1 or 2 IPv4 addresses.
    79  	IpAddresses pulumi.StringArrayOutput `pulumi:"ipAddresses"`
    80  	// IP address set associated with the accelerator.
    81  	IpSets AcceleratorIpSetArrayOutput `pulumi:"ipSets"`
    82  	// The name of the accelerator.
    83  	Name pulumi.StringOutput `pulumi:"name"`
    84  	// A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    85  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    86  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    87  	//
    88  	// Deprecated: Please use `tags` instead.
    89  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    90  }
    91  
    92  // NewAccelerator registers a new resource with the given unique name, arguments, and options.
    93  func NewAccelerator(ctx *pulumi.Context,
    94  	name string, args *AcceleratorArgs, opts ...pulumi.ResourceOption) (*Accelerator, error) {
    95  	if args == nil {
    96  		args = &AcceleratorArgs{}
    97  	}
    98  
    99  	opts = internal.PkgResourceDefaultOpts(opts)
   100  	var resource Accelerator
   101  	err := ctx.RegisterResource("aws:globalaccelerator/accelerator:Accelerator", name, args, &resource, opts...)
   102  	if err != nil {
   103  		return nil, err
   104  	}
   105  	return &resource, nil
   106  }
   107  
   108  // GetAccelerator gets an existing Accelerator resource's state with the given name, ID, and optional
   109  // state properties that are used to uniquely qualify the lookup (nil if not required).
   110  func GetAccelerator(ctx *pulumi.Context,
   111  	name string, id pulumi.IDInput, state *AcceleratorState, opts ...pulumi.ResourceOption) (*Accelerator, error) {
   112  	var resource Accelerator
   113  	err := ctx.ReadResource("aws:globalaccelerator/accelerator:Accelerator", name, id, state, &resource, opts...)
   114  	if err != nil {
   115  		return nil, err
   116  	}
   117  	return &resource, nil
   118  }
   119  
   120  // Input properties used for looking up and filtering Accelerator resources.
   121  type acceleratorState struct {
   122  	// The attributes of the accelerator. Fields documented below.
   123  	Attributes *AcceleratorAttributes `pulumi:"attributes"`
   124  	// The DNS name of the accelerator. For example, `a5d53ff5ee6bca4ce.awsglobalaccelerator.com`.
   125  	DnsName *string `pulumi:"dnsName"`
   126  	// The Domain Name System (DNS) name that Global Accelerator creates that points to a dual-stack accelerator's four static IP addresses: two IPv4 addresses and two IPv6 addresses. For example, `a1234567890abcdef.dualstack.awsglobalaccelerator.com`.
   127  	DualStackDnsName *string `pulumi:"dualStackDnsName"`
   128  	// Indicates whether the accelerator is enabled. Defaults to `true`. Valid values: `true`, `false`.
   129  	Enabled *bool `pulumi:"enabled"`
   130  	// -  The Global Accelerator Route 53 zone ID that can be used to
   131  	//    route an [Alias Resource Record Set](https://docs.aws.amazon.com/Route53/latest/APIReference/API_AliasTarget.html) to the Global Accelerator. This attribute
   132  	//    is simply an alias for the zone ID `Z2BJ6XQ5FK7U4H`.
   133  	HostedZoneId *string `pulumi:"hostedZoneId"`
   134  	// The value for the address type. Defaults to `IPV4`. Valid values: `IPV4`, `DUAL_STACK`.
   135  	IpAddressType *string `pulumi:"ipAddressType"`
   136  	// The IP addresses to use for BYOIP accelerators. If not specified, the service assigns IP addresses. Valid values: 1 or 2 IPv4 addresses.
   137  	IpAddresses []string `pulumi:"ipAddresses"`
   138  	// IP address set associated with the accelerator.
   139  	IpSets []AcceleratorIpSet `pulumi:"ipSets"`
   140  	// The name of the accelerator.
   141  	Name *string `pulumi:"name"`
   142  	// A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   143  	Tags map[string]string `pulumi:"tags"`
   144  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   145  	//
   146  	// Deprecated: Please use `tags` instead.
   147  	TagsAll map[string]string `pulumi:"tagsAll"`
   148  }
   149  
   150  type AcceleratorState struct {
   151  	// The attributes of the accelerator. Fields documented below.
   152  	Attributes AcceleratorAttributesPtrInput
   153  	// The DNS name of the accelerator. For example, `a5d53ff5ee6bca4ce.awsglobalaccelerator.com`.
   154  	DnsName pulumi.StringPtrInput
   155  	// The Domain Name System (DNS) name that Global Accelerator creates that points to a dual-stack accelerator's four static IP addresses: two IPv4 addresses and two IPv6 addresses. For example, `a1234567890abcdef.dualstack.awsglobalaccelerator.com`.
   156  	DualStackDnsName pulumi.StringPtrInput
   157  	// Indicates whether the accelerator is enabled. Defaults to `true`. Valid values: `true`, `false`.
   158  	Enabled pulumi.BoolPtrInput
   159  	// -  The Global Accelerator Route 53 zone ID that can be used to
   160  	//    route an [Alias Resource Record Set](https://docs.aws.amazon.com/Route53/latest/APIReference/API_AliasTarget.html) to the Global Accelerator. This attribute
   161  	//    is simply an alias for the zone ID `Z2BJ6XQ5FK7U4H`.
   162  	HostedZoneId pulumi.StringPtrInput
   163  	// The value for the address type. Defaults to `IPV4`. Valid values: `IPV4`, `DUAL_STACK`.
   164  	IpAddressType pulumi.StringPtrInput
   165  	// The IP addresses to use for BYOIP accelerators. If not specified, the service assigns IP addresses. Valid values: 1 or 2 IPv4 addresses.
   166  	IpAddresses pulumi.StringArrayInput
   167  	// IP address set associated with the accelerator.
   168  	IpSets AcceleratorIpSetArrayInput
   169  	// The name of the accelerator.
   170  	Name pulumi.StringPtrInput
   171  	// A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   172  	Tags pulumi.StringMapInput
   173  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   174  	//
   175  	// Deprecated: Please use `tags` instead.
   176  	TagsAll pulumi.StringMapInput
   177  }
   178  
   179  func (AcceleratorState) ElementType() reflect.Type {
   180  	return reflect.TypeOf((*acceleratorState)(nil)).Elem()
   181  }
   182  
   183  type acceleratorArgs struct {
   184  	// The attributes of the accelerator. Fields documented below.
   185  	Attributes *AcceleratorAttributes `pulumi:"attributes"`
   186  	// Indicates whether the accelerator is enabled. Defaults to `true`. Valid values: `true`, `false`.
   187  	Enabled *bool `pulumi:"enabled"`
   188  	// The value for the address type. Defaults to `IPV4`. Valid values: `IPV4`, `DUAL_STACK`.
   189  	IpAddressType *string `pulumi:"ipAddressType"`
   190  	// The IP addresses to use for BYOIP accelerators. If not specified, the service assigns IP addresses. Valid values: 1 or 2 IPv4 addresses.
   191  	IpAddresses []string `pulumi:"ipAddresses"`
   192  	// The name of the accelerator.
   193  	Name *string `pulumi:"name"`
   194  	// A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   195  	Tags map[string]string `pulumi:"tags"`
   196  }
   197  
   198  // The set of arguments for constructing a Accelerator resource.
   199  type AcceleratorArgs struct {
   200  	// The attributes of the accelerator. Fields documented below.
   201  	Attributes AcceleratorAttributesPtrInput
   202  	// Indicates whether the accelerator is enabled. Defaults to `true`. Valid values: `true`, `false`.
   203  	Enabled pulumi.BoolPtrInput
   204  	// The value for the address type. Defaults to `IPV4`. Valid values: `IPV4`, `DUAL_STACK`.
   205  	IpAddressType pulumi.StringPtrInput
   206  	// The IP addresses to use for BYOIP accelerators. If not specified, the service assigns IP addresses. Valid values: 1 or 2 IPv4 addresses.
   207  	IpAddresses pulumi.StringArrayInput
   208  	// The name of the accelerator.
   209  	Name pulumi.StringPtrInput
   210  	// A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   211  	Tags pulumi.StringMapInput
   212  }
   213  
   214  func (AcceleratorArgs) ElementType() reflect.Type {
   215  	return reflect.TypeOf((*acceleratorArgs)(nil)).Elem()
   216  }
   217  
   218  type AcceleratorInput interface {
   219  	pulumi.Input
   220  
   221  	ToAcceleratorOutput() AcceleratorOutput
   222  	ToAcceleratorOutputWithContext(ctx context.Context) AcceleratorOutput
   223  }
   224  
   225  func (*Accelerator) ElementType() reflect.Type {
   226  	return reflect.TypeOf((**Accelerator)(nil)).Elem()
   227  }
   228  
   229  func (i *Accelerator) ToAcceleratorOutput() AcceleratorOutput {
   230  	return i.ToAcceleratorOutputWithContext(context.Background())
   231  }
   232  
   233  func (i *Accelerator) ToAcceleratorOutputWithContext(ctx context.Context) AcceleratorOutput {
   234  	return pulumi.ToOutputWithContext(ctx, i).(AcceleratorOutput)
   235  }
   236  
   237  // AcceleratorArrayInput is an input type that accepts AcceleratorArray and AcceleratorArrayOutput values.
   238  // You can construct a concrete instance of `AcceleratorArrayInput` via:
   239  //
   240  //	AcceleratorArray{ AcceleratorArgs{...} }
   241  type AcceleratorArrayInput interface {
   242  	pulumi.Input
   243  
   244  	ToAcceleratorArrayOutput() AcceleratorArrayOutput
   245  	ToAcceleratorArrayOutputWithContext(context.Context) AcceleratorArrayOutput
   246  }
   247  
   248  type AcceleratorArray []AcceleratorInput
   249  
   250  func (AcceleratorArray) ElementType() reflect.Type {
   251  	return reflect.TypeOf((*[]*Accelerator)(nil)).Elem()
   252  }
   253  
   254  func (i AcceleratorArray) ToAcceleratorArrayOutput() AcceleratorArrayOutput {
   255  	return i.ToAcceleratorArrayOutputWithContext(context.Background())
   256  }
   257  
   258  func (i AcceleratorArray) ToAcceleratorArrayOutputWithContext(ctx context.Context) AcceleratorArrayOutput {
   259  	return pulumi.ToOutputWithContext(ctx, i).(AcceleratorArrayOutput)
   260  }
   261  
   262  // AcceleratorMapInput is an input type that accepts AcceleratorMap and AcceleratorMapOutput values.
   263  // You can construct a concrete instance of `AcceleratorMapInput` via:
   264  //
   265  //	AcceleratorMap{ "key": AcceleratorArgs{...} }
   266  type AcceleratorMapInput interface {
   267  	pulumi.Input
   268  
   269  	ToAcceleratorMapOutput() AcceleratorMapOutput
   270  	ToAcceleratorMapOutputWithContext(context.Context) AcceleratorMapOutput
   271  }
   272  
   273  type AcceleratorMap map[string]AcceleratorInput
   274  
   275  func (AcceleratorMap) ElementType() reflect.Type {
   276  	return reflect.TypeOf((*map[string]*Accelerator)(nil)).Elem()
   277  }
   278  
   279  func (i AcceleratorMap) ToAcceleratorMapOutput() AcceleratorMapOutput {
   280  	return i.ToAcceleratorMapOutputWithContext(context.Background())
   281  }
   282  
   283  func (i AcceleratorMap) ToAcceleratorMapOutputWithContext(ctx context.Context) AcceleratorMapOutput {
   284  	return pulumi.ToOutputWithContext(ctx, i).(AcceleratorMapOutput)
   285  }
   286  
   287  type AcceleratorOutput struct{ *pulumi.OutputState }
   288  
   289  func (AcceleratorOutput) ElementType() reflect.Type {
   290  	return reflect.TypeOf((**Accelerator)(nil)).Elem()
   291  }
   292  
   293  func (o AcceleratorOutput) ToAcceleratorOutput() AcceleratorOutput {
   294  	return o
   295  }
   296  
   297  func (o AcceleratorOutput) ToAcceleratorOutputWithContext(ctx context.Context) AcceleratorOutput {
   298  	return o
   299  }
   300  
   301  // The attributes of the accelerator. Fields documented below.
   302  func (o AcceleratorOutput) Attributes() AcceleratorAttributesPtrOutput {
   303  	return o.ApplyT(func(v *Accelerator) AcceleratorAttributesPtrOutput { return v.Attributes }).(AcceleratorAttributesPtrOutput)
   304  }
   305  
   306  // The DNS name of the accelerator. For example, `a5d53ff5ee6bca4ce.awsglobalaccelerator.com`.
   307  func (o AcceleratorOutput) DnsName() pulumi.StringOutput {
   308  	return o.ApplyT(func(v *Accelerator) pulumi.StringOutput { return v.DnsName }).(pulumi.StringOutput)
   309  }
   310  
   311  // The Domain Name System (DNS) name that Global Accelerator creates that points to a dual-stack accelerator's four static IP addresses: two IPv4 addresses and two IPv6 addresses. For example, `a1234567890abcdef.dualstack.awsglobalaccelerator.com`.
   312  func (o AcceleratorOutput) DualStackDnsName() pulumi.StringOutput {
   313  	return o.ApplyT(func(v *Accelerator) pulumi.StringOutput { return v.DualStackDnsName }).(pulumi.StringOutput)
   314  }
   315  
   316  // Indicates whether the accelerator is enabled. Defaults to `true`. Valid values: `true`, `false`.
   317  func (o AcceleratorOutput) Enabled() pulumi.BoolPtrOutput {
   318  	return o.ApplyT(func(v *Accelerator) pulumi.BoolPtrOutput { return v.Enabled }).(pulumi.BoolPtrOutput)
   319  }
   320  
   321  //   - The Global Accelerator Route 53 zone ID that can be used to
   322  //     route an [Alias Resource Record Set](https://docs.aws.amazon.com/Route53/latest/APIReference/API_AliasTarget.html) to the Global Accelerator. This attribute
   323  //     is simply an alias for the zone ID `Z2BJ6XQ5FK7U4H`.
   324  func (o AcceleratorOutput) HostedZoneId() pulumi.StringOutput {
   325  	return o.ApplyT(func(v *Accelerator) pulumi.StringOutput { return v.HostedZoneId }).(pulumi.StringOutput)
   326  }
   327  
   328  // The value for the address type. Defaults to `IPV4`. Valid values: `IPV4`, `DUAL_STACK`.
   329  func (o AcceleratorOutput) IpAddressType() pulumi.StringPtrOutput {
   330  	return o.ApplyT(func(v *Accelerator) pulumi.StringPtrOutput { return v.IpAddressType }).(pulumi.StringPtrOutput)
   331  }
   332  
   333  // The IP addresses to use for BYOIP accelerators. If not specified, the service assigns IP addresses. Valid values: 1 or 2 IPv4 addresses.
   334  func (o AcceleratorOutput) IpAddresses() pulumi.StringArrayOutput {
   335  	return o.ApplyT(func(v *Accelerator) pulumi.StringArrayOutput { return v.IpAddresses }).(pulumi.StringArrayOutput)
   336  }
   337  
   338  // IP address set associated with the accelerator.
   339  func (o AcceleratorOutput) IpSets() AcceleratorIpSetArrayOutput {
   340  	return o.ApplyT(func(v *Accelerator) AcceleratorIpSetArrayOutput { return v.IpSets }).(AcceleratorIpSetArrayOutput)
   341  }
   342  
   343  // The name of the accelerator.
   344  func (o AcceleratorOutput) Name() pulumi.StringOutput {
   345  	return o.ApplyT(func(v *Accelerator) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   346  }
   347  
   348  // A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   349  func (o AcceleratorOutput) Tags() pulumi.StringMapOutput {
   350  	return o.ApplyT(func(v *Accelerator) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   351  }
   352  
   353  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   354  //
   355  // Deprecated: Please use `tags` instead.
   356  func (o AcceleratorOutput) TagsAll() pulumi.StringMapOutput {
   357  	return o.ApplyT(func(v *Accelerator) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   358  }
   359  
   360  type AcceleratorArrayOutput struct{ *pulumi.OutputState }
   361  
   362  func (AcceleratorArrayOutput) ElementType() reflect.Type {
   363  	return reflect.TypeOf((*[]*Accelerator)(nil)).Elem()
   364  }
   365  
   366  func (o AcceleratorArrayOutput) ToAcceleratorArrayOutput() AcceleratorArrayOutput {
   367  	return o
   368  }
   369  
   370  func (o AcceleratorArrayOutput) ToAcceleratorArrayOutputWithContext(ctx context.Context) AcceleratorArrayOutput {
   371  	return o
   372  }
   373  
   374  func (o AcceleratorArrayOutput) Index(i pulumi.IntInput) AcceleratorOutput {
   375  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Accelerator {
   376  		return vs[0].([]*Accelerator)[vs[1].(int)]
   377  	}).(AcceleratorOutput)
   378  }
   379  
   380  type AcceleratorMapOutput struct{ *pulumi.OutputState }
   381  
   382  func (AcceleratorMapOutput) ElementType() reflect.Type {
   383  	return reflect.TypeOf((*map[string]*Accelerator)(nil)).Elem()
   384  }
   385  
   386  func (o AcceleratorMapOutput) ToAcceleratorMapOutput() AcceleratorMapOutput {
   387  	return o
   388  }
   389  
   390  func (o AcceleratorMapOutput) ToAcceleratorMapOutputWithContext(ctx context.Context) AcceleratorMapOutput {
   391  	return o
   392  }
   393  
   394  func (o AcceleratorMapOutput) MapIndex(k pulumi.StringInput) AcceleratorOutput {
   395  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Accelerator {
   396  		return vs[0].(map[string]*Accelerator)[vs[1].(string)]
   397  	}).(AcceleratorOutput)
   398  }
   399  
   400  func init() {
   401  	pulumi.RegisterInputType(reflect.TypeOf((*AcceleratorInput)(nil)).Elem(), &Accelerator{})
   402  	pulumi.RegisterInputType(reflect.TypeOf((*AcceleratorArrayInput)(nil)).Elem(), AcceleratorArray{})
   403  	pulumi.RegisterInputType(reflect.TypeOf((*AcceleratorMapInput)(nil)).Elem(), AcceleratorMap{})
   404  	pulumi.RegisterOutputType(AcceleratorOutput{})
   405  	pulumi.RegisterOutputType(AcceleratorArrayOutput{})
   406  	pulumi.RegisterOutputType(AcceleratorMapOutput{})
   407  }