github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/elb/sslNegotiationPolicy.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 elb
     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  // Provides a load balancer SSL negotiation policy, which allows an ELB to control the ciphers and protocols that are supported during SSL negotiations between a client and a load balancer.
    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/elb"
    26  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    27  //
    28  // )
    29  //
    30  //	func main() {
    31  //		pulumi.Run(func(ctx *pulumi.Context) error {
    32  //			lb, err := elb.NewLoadBalancer(ctx, "lb", &elb.LoadBalancerArgs{
    33  //				Name: pulumi.String("test-lb"),
    34  //				AvailabilityZones: pulumi.StringArray{
    35  //					pulumi.String("us-east-1a"),
    36  //				},
    37  //				Listeners: elb.LoadBalancerListenerArray{
    38  //					&elb.LoadBalancerListenerArgs{
    39  //						InstancePort:     pulumi.Int(8000),
    40  //						InstanceProtocol: pulumi.String("https"),
    41  //						LbPort:           pulumi.Int(443),
    42  //						LbProtocol:       pulumi.String("https"),
    43  //						SslCertificateId: pulumi.String("arn:aws:iam::123456789012:server-certificate/certName"),
    44  //					},
    45  //				},
    46  //			})
    47  //			if err != nil {
    48  //				return err
    49  //			}
    50  //			_, err = elb.NewSslNegotiationPolicy(ctx, "foo", &elb.SslNegotiationPolicyArgs{
    51  //				Name:         pulumi.String("foo-policy"),
    52  //				LoadBalancer: lb.ID(),
    53  //				LbPort:       pulumi.Int(443),
    54  //				Attributes: elb.SslNegotiationPolicyAttributeArray{
    55  //					&elb.SslNegotiationPolicyAttributeArgs{
    56  //						Name:  pulumi.String("Protocol-TLSv1"),
    57  //						Value: pulumi.String("false"),
    58  //					},
    59  //					&elb.SslNegotiationPolicyAttributeArgs{
    60  //						Name:  pulumi.String("Protocol-TLSv1.1"),
    61  //						Value: pulumi.String("false"),
    62  //					},
    63  //					&elb.SslNegotiationPolicyAttributeArgs{
    64  //						Name:  pulumi.String("Protocol-TLSv1.2"),
    65  //						Value: pulumi.String("true"),
    66  //					},
    67  //					&elb.SslNegotiationPolicyAttributeArgs{
    68  //						Name:  pulumi.String("Server-Defined-Cipher-Order"),
    69  //						Value: pulumi.String("true"),
    70  //					},
    71  //					&elb.SslNegotiationPolicyAttributeArgs{
    72  //						Name:  pulumi.String("ECDHE-RSA-AES128-GCM-SHA256"),
    73  //						Value: pulumi.String("true"),
    74  //					},
    75  //					&elb.SslNegotiationPolicyAttributeArgs{
    76  //						Name:  pulumi.String("AES128-GCM-SHA256"),
    77  //						Value: pulumi.String("true"),
    78  //					},
    79  //					&elb.SslNegotiationPolicyAttributeArgs{
    80  //						Name:  pulumi.String("EDH-RSA-DES-CBC3-SHA"),
    81  //						Value: pulumi.String("false"),
    82  //					},
    83  //				},
    84  //			})
    85  //			if err != nil {
    86  //				return err
    87  //			}
    88  //			return nil
    89  //		})
    90  //	}
    91  //
    92  // ```
    93  // <!--End PulumiCodeChooser -->
    94  type SslNegotiationPolicy struct {
    95  	pulumi.CustomResourceState
    96  
    97  	// An SSL Negotiation policy attribute. Each has two properties:
    98  	Attributes SslNegotiationPolicyAttributeArrayOutput `pulumi:"attributes"`
    99  	// The load balancer port to which the policy
   100  	// should be applied. This must be an active listener on the load
   101  	// balancer.
   102  	LbPort pulumi.IntOutput `pulumi:"lbPort"`
   103  	// The load balancer to which the policy
   104  	// should be attached.
   105  	LoadBalancer pulumi.StringOutput `pulumi:"loadBalancer"`
   106  	// The name of the attribute
   107  	Name pulumi.StringOutput `pulumi:"name"`
   108  	// Map of arbitrary keys and values that, when changed, will trigger a redeployment.
   109  	//
   110  	// To set your attributes, please see the [AWS Elastic Load Balancing Developer Guide](http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-security-policy-table.html) for a listing of the supported SSL protocols, SSL options, and SSL ciphers.
   111  	//
   112  	// > **NOTE:** The AWS documentation references Server Order Preference, which the AWS Elastic Load Balancing API refers to as `Server-Defined-Cipher-Order`. If you wish to set Server Order Preference, use this value instead.
   113  	Triggers pulumi.StringMapOutput `pulumi:"triggers"`
   114  }
   115  
   116  // NewSslNegotiationPolicy registers a new resource with the given unique name, arguments, and options.
   117  func NewSslNegotiationPolicy(ctx *pulumi.Context,
   118  	name string, args *SslNegotiationPolicyArgs, opts ...pulumi.ResourceOption) (*SslNegotiationPolicy, error) {
   119  	if args == nil {
   120  		return nil, errors.New("missing one or more required arguments")
   121  	}
   122  
   123  	if args.LbPort == nil {
   124  		return nil, errors.New("invalid value for required argument 'LbPort'")
   125  	}
   126  	if args.LoadBalancer == nil {
   127  		return nil, errors.New("invalid value for required argument 'LoadBalancer'")
   128  	}
   129  	aliases := pulumi.Aliases([]pulumi.Alias{
   130  		{
   131  			Type: pulumi.String("aws:elasticloadbalancing/sslNegotiationPolicy:SslNegotiationPolicy"),
   132  		},
   133  	})
   134  	opts = append(opts, aliases)
   135  	opts = internal.PkgResourceDefaultOpts(opts)
   136  	var resource SslNegotiationPolicy
   137  	err := ctx.RegisterResource("aws:elb/sslNegotiationPolicy:SslNegotiationPolicy", name, args, &resource, opts...)
   138  	if err != nil {
   139  		return nil, err
   140  	}
   141  	return &resource, nil
   142  }
   143  
   144  // GetSslNegotiationPolicy gets an existing SslNegotiationPolicy resource's state with the given name, ID, and optional
   145  // state properties that are used to uniquely qualify the lookup (nil if not required).
   146  func GetSslNegotiationPolicy(ctx *pulumi.Context,
   147  	name string, id pulumi.IDInput, state *SslNegotiationPolicyState, opts ...pulumi.ResourceOption) (*SslNegotiationPolicy, error) {
   148  	var resource SslNegotiationPolicy
   149  	err := ctx.ReadResource("aws:elb/sslNegotiationPolicy:SslNegotiationPolicy", name, id, state, &resource, opts...)
   150  	if err != nil {
   151  		return nil, err
   152  	}
   153  	return &resource, nil
   154  }
   155  
   156  // Input properties used for looking up and filtering SslNegotiationPolicy resources.
   157  type sslNegotiationPolicyState struct {
   158  	// An SSL Negotiation policy attribute. Each has two properties:
   159  	Attributes []SslNegotiationPolicyAttribute `pulumi:"attributes"`
   160  	// The load balancer port to which the policy
   161  	// should be applied. This must be an active listener on the load
   162  	// balancer.
   163  	LbPort *int `pulumi:"lbPort"`
   164  	// The load balancer to which the policy
   165  	// should be attached.
   166  	LoadBalancer *string `pulumi:"loadBalancer"`
   167  	// The name of the attribute
   168  	Name *string `pulumi:"name"`
   169  	// Map of arbitrary keys and values that, when changed, will trigger a redeployment.
   170  	//
   171  	// To set your attributes, please see the [AWS Elastic Load Balancing Developer Guide](http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-security-policy-table.html) for a listing of the supported SSL protocols, SSL options, and SSL ciphers.
   172  	//
   173  	// > **NOTE:** The AWS documentation references Server Order Preference, which the AWS Elastic Load Balancing API refers to as `Server-Defined-Cipher-Order`. If you wish to set Server Order Preference, use this value instead.
   174  	Triggers map[string]string `pulumi:"triggers"`
   175  }
   176  
   177  type SslNegotiationPolicyState struct {
   178  	// An SSL Negotiation policy attribute. Each has two properties:
   179  	Attributes SslNegotiationPolicyAttributeArrayInput
   180  	// The load balancer port to which the policy
   181  	// should be applied. This must be an active listener on the load
   182  	// balancer.
   183  	LbPort pulumi.IntPtrInput
   184  	// The load balancer to which the policy
   185  	// should be attached.
   186  	LoadBalancer pulumi.StringPtrInput
   187  	// The name of the attribute
   188  	Name pulumi.StringPtrInput
   189  	// Map of arbitrary keys and values that, when changed, will trigger a redeployment.
   190  	//
   191  	// To set your attributes, please see the [AWS Elastic Load Balancing Developer Guide](http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-security-policy-table.html) for a listing of the supported SSL protocols, SSL options, and SSL ciphers.
   192  	//
   193  	// > **NOTE:** The AWS documentation references Server Order Preference, which the AWS Elastic Load Balancing API refers to as `Server-Defined-Cipher-Order`. If you wish to set Server Order Preference, use this value instead.
   194  	Triggers pulumi.StringMapInput
   195  }
   196  
   197  func (SslNegotiationPolicyState) ElementType() reflect.Type {
   198  	return reflect.TypeOf((*sslNegotiationPolicyState)(nil)).Elem()
   199  }
   200  
   201  type sslNegotiationPolicyArgs struct {
   202  	// An SSL Negotiation policy attribute. Each has two properties:
   203  	Attributes []SslNegotiationPolicyAttribute `pulumi:"attributes"`
   204  	// The load balancer port to which the policy
   205  	// should be applied. This must be an active listener on the load
   206  	// balancer.
   207  	LbPort int `pulumi:"lbPort"`
   208  	// The load balancer to which the policy
   209  	// should be attached.
   210  	LoadBalancer string `pulumi:"loadBalancer"`
   211  	// The name of the attribute
   212  	Name *string `pulumi:"name"`
   213  	// Map of arbitrary keys and values that, when changed, will trigger a redeployment.
   214  	//
   215  	// To set your attributes, please see the [AWS Elastic Load Balancing Developer Guide](http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-security-policy-table.html) for a listing of the supported SSL protocols, SSL options, and SSL ciphers.
   216  	//
   217  	// > **NOTE:** The AWS documentation references Server Order Preference, which the AWS Elastic Load Balancing API refers to as `Server-Defined-Cipher-Order`. If you wish to set Server Order Preference, use this value instead.
   218  	Triggers map[string]string `pulumi:"triggers"`
   219  }
   220  
   221  // The set of arguments for constructing a SslNegotiationPolicy resource.
   222  type SslNegotiationPolicyArgs struct {
   223  	// An SSL Negotiation policy attribute. Each has two properties:
   224  	Attributes SslNegotiationPolicyAttributeArrayInput
   225  	// The load balancer port to which the policy
   226  	// should be applied. This must be an active listener on the load
   227  	// balancer.
   228  	LbPort pulumi.IntInput
   229  	// The load balancer to which the policy
   230  	// should be attached.
   231  	LoadBalancer pulumi.StringInput
   232  	// The name of the attribute
   233  	Name pulumi.StringPtrInput
   234  	// Map of arbitrary keys and values that, when changed, will trigger a redeployment.
   235  	//
   236  	// To set your attributes, please see the [AWS Elastic Load Balancing Developer Guide](http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-security-policy-table.html) for a listing of the supported SSL protocols, SSL options, and SSL ciphers.
   237  	//
   238  	// > **NOTE:** The AWS documentation references Server Order Preference, which the AWS Elastic Load Balancing API refers to as `Server-Defined-Cipher-Order`. If you wish to set Server Order Preference, use this value instead.
   239  	Triggers pulumi.StringMapInput
   240  }
   241  
   242  func (SslNegotiationPolicyArgs) ElementType() reflect.Type {
   243  	return reflect.TypeOf((*sslNegotiationPolicyArgs)(nil)).Elem()
   244  }
   245  
   246  type SslNegotiationPolicyInput interface {
   247  	pulumi.Input
   248  
   249  	ToSslNegotiationPolicyOutput() SslNegotiationPolicyOutput
   250  	ToSslNegotiationPolicyOutputWithContext(ctx context.Context) SslNegotiationPolicyOutput
   251  }
   252  
   253  func (*SslNegotiationPolicy) ElementType() reflect.Type {
   254  	return reflect.TypeOf((**SslNegotiationPolicy)(nil)).Elem()
   255  }
   256  
   257  func (i *SslNegotiationPolicy) ToSslNegotiationPolicyOutput() SslNegotiationPolicyOutput {
   258  	return i.ToSslNegotiationPolicyOutputWithContext(context.Background())
   259  }
   260  
   261  func (i *SslNegotiationPolicy) ToSslNegotiationPolicyOutputWithContext(ctx context.Context) SslNegotiationPolicyOutput {
   262  	return pulumi.ToOutputWithContext(ctx, i).(SslNegotiationPolicyOutput)
   263  }
   264  
   265  // SslNegotiationPolicyArrayInput is an input type that accepts SslNegotiationPolicyArray and SslNegotiationPolicyArrayOutput values.
   266  // You can construct a concrete instance of `SslNegotiationPolicyArrayInput` via:
   267  //
   268  //	SslNegotiationPolicyArray{ SslNegotiationPolicyArgs{...} }
   269  type SslNegotiationPolicyArrayInput interface {
   270  	pulumi.Input
   271  
   272  	ToSslNegotiationPolicyArrayOutput() SslNegotiationPolicyArrayOutput
   273  	ToSslNegotiationPolicyArrayOutputWithContext(context.Context) SslNegotiationPolicyArrayOutput
   274  }
   275  
   276  type SslNegotiationPolicyArray []SslNegotiationPolicyInput
   277  
   278  func (SslNegotiationPolicyArray) ElementType() reflect.Type {
   279  	return reflect.TypeOf((*[]*SslNegotiationPolicy)(nil)).Elem()
   280  }
   281  
   282  func (i SslNegotiationPolicyArray) ToSslNegotiationPolicyArrayOutput() SslNegotiationPolicyArrayOutput {
   283  	return i.ToSslNegotiationPolicyArrayOutputWithContext(context.Background())
   284  }
   285  
   286  func (i SslNegotiationPolicyArray) ToSslNegotiationPolicyArrayOutputWithContext(ctx context.Context) SslNegotiationPolicyArrayOutput {
   287  	return pulumi.ToOutputWithContext(ctx, i).(SslNegotiationPolicyArrayOutput)
   288  }
   289  
   290  // SslNegotiationPolicyMapInput is an input type that accepts SslNegotiationPolicyMap and SslNegotiationPolicyMapOutput values.
   291  // You can construct a concrete instance of `SslNegotiationPolicyMapInput` via:
   292  //
   293  //	SslNegotiationPolicyMap{ "key": SslNegotiationPolicyArgs{...} }
   294  type SslNegotiationPolicyMapInput interface {
   295  	pulumi.Input
   296  
   297  	ToSslNegotiationPolicyMapOutput() SslNegotiationPolicyMapOutput
   298  	ToSslNegotiationPolicyMapOutputWithContext(context.Context) SslNegotiationPolicyMapOutput
   299  }
   300  
   301  type SslNegotiationPolicyMap map[string]SslNegotiationPolicyInput
   302  
   303  func (SslNegotiationPolicyMap) ElementType() reflect.Type {
   304  	return reflect.TypeOf((*map[string]*SslNegotiationPolicy)(nil)).Elem()
   305  }
   306  
   307  func (i SslNegotiationPolicyMap) ToSslNegotiationPolicyMapOutput() SslNegotiationPolicyMapOutput {
   308  	return i.ToSslNegotiationPolicyMapOutputWithContext(context.Background())
   309  }
   310  
   311  func (i SslNegotiationPolicyMap) ToSslNegotiationPolicyMapOutputWithContext(ctx context.Context) SslNegotiationPolicyMapOutput {
   312  	return pulumi.ToOutputWithContext(ctx, i).(SslNegotiationPolicyMapOutput)
   313  }
   314  
   315  type SslNegotiationPolicyOutput struct{ *pulumi.OutputState }
   316  
   317  func (SslNegotiationPolicyOutput) ElementType() reflect.Type {
   318  	return reflect.TypeOf((**SslNegotiationPolicy)(nil)).Elem()
   319  }
   320  
   321  func (o SslNegotiationPolicyOutput) ToSslNegotiationPolicyOutput() SslNegotiationPolicyOutput {
   322  	return o
   323  }
   324  
   325  func (o SslNegotiationPolicyOutput) ToSslNegotiationPolicyOutputWithContext(ctx context.Context) SslNegotiationPolicyOutput {
   326  	return o
   327  }
   328  
   329  // An SSL Negotiation policy attribute. Each has two properties:
   330  func (o SslNegotiationPolicyOutput) Attributes() SslNegotiationPolicyAttributeArrayOutput {
   331  	return o.ApplyT(func(v *SslNegotiationPolicy) SslNegotiationPolicyAttributeArrayOutput { return v.Attributes }).(SslNegotiationPolicyAttributeArrayOutput)
   332  }
   333  
   334  // The load balancer port to which the policy
   335  // should be applied. This must be an active listener on the load
   336  // balancer.
   337  func (o SslNegotiationPolicyOutput) LbPort() pulumi.IntOutput {
   338  	return o.ApplyT(func(v *SslNegotiationPolicy) pulumi.IntOutput { return v.LbPort }).(pulumi.IntOutput)
   339  }
   340  
   341  // The load balancer to which the policy
   342  // should be attached.
   343  func (o SslNegotiationPolicyOutput) LoadBalancer() pulumi.StringOutput {
   344  	return o.ApplyT(func(v *SslNegotiationPolicy) pulumi.StringOutput { return v.LoadBalancer }).(pulumi.StringOutput)
   345  }
   346  
   347  // The name of the attribute
   348  func (o SslNegotiationPolicyOutput) Name() pulumi.StringOutput {
   349  	return o.ApplyT(func(v *SslNegotiationPolicy) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   350  }
   351  
   352  // Map of arbitrary keys and values that, when changed, will trigger a redeployment.
   353  //
   354  // To set your attributes, please see the [AWS Elastic Load Balancing Developer Guide](http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-security-policy-table.html) for a listing of the supported SSL protocols, SSL options, and SSL ciphers.
   355  //
   356  // > **NOTE:** The AWS documentation references Server Order Preference, which the AWS Elastic Load Balancing API refers to as `Server-Defined-Cipher-Order`. If you wish to set Server Order Preference, use this value instead.
   357  func (o SslNegotiationPolicyOutput) Triggers() pulumi.StringMapOutput {
   358  	return o.ApplyT(func(v *SslNegotiationPolicy) pulumi.StringMapOutput { return v.Triggers }).(pulumi.StringMapOutput)
   359  }
   360  
   361  type SslNegotiationPolicyArrayOutput struct{ *pulumi.OutputState }
   362  
   363  func (SslNegotiationPolicyArrayOutput) ElementType() reflect.Type {
   364  	return reflect.TypeOf((*[]*SslNegotiationPolicy)(nil)).Elem()
   365  }
   366  
   367  func (o SslNegotiationPolicyArrayOutput) ToSslNegotiationPolicyArrayOutput() SslNegotiationPolicyArrayOutput {
   368  	return o
   369  }
   370  
   371  func (o SslNegotiationPolicyArrayOutput) ToSslNegotiationPolicyArrayOutputWithContext(ctx context.Context) SslNegotiationPolicyArrayOutput {
   372  	return o
   373  }
   374  
   375  func (o SslNegotiationPolicyArrayOutput) Index(i pulumi.IntInput) SslNegotiationPolicyOutput {
   376  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SslNegotiationPolicy {
   377  		return vs[0].([]*SslNegotiationPolicy)[vs[1].(int)]
   378  	}).(SslNegotiationPolicyOutput)
   379  }
   380  
   381  type SslNegotiationPolicyMapOutput struct{ *pulumi.OutputState }
   382  
   383  func (SslNegotiationPolicyMapOutput) ElementType() reflect.Type {
   384  	return reflect.TypeOf((*map[string]*SslNegotiationPolicy)(nil)).Elem()
   385  }
   386  
   387  func (o SslNegotiationPolicyMapOutput) ToSslNegotiationPolicyMapOutput() SslNegotiationPolicyMapOutput {
   388  	return o
   389  }
   390  
   391  func (o SslNegotiationPolicyMapOutput) ToSslNegotiationPolicyMapOutputWithContext(ctx context.Context) SslNegotiationPolicyMapOutput {
   392  	return o
   393  }
   394  
   395  func (o SslNegotiationPolicyMapOutput) MapIndex(k pulumi.StringInput) SslNegotiationPolicyOutput {
   396  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SslNegotiationPolicy {
   397  		return vs[0].(map[string]*SslNegotiationPolicy)[vs[1].(string)]
   398  	}).(SslNegotiationPolicyOutput)
   399  }
   400  
   401  func init() {
   402  	pulumi.RegisterInputType(reflect.TypeOf((*SslNegotiationPolicyInput)(nil)).Elem(), &SslNegotiationPolicy{})
   403  	pulumi.RegisterInputType(reflect.TypeOf((*SslNegotiationPolicyArrayInput)(nil)).Elem(), SslNegotiationPolicyArray{})
   404  	pulumi.RegisterInputType(reflect.TypeOf((*SslNegotiationPolicyMapInput)(nil)).Elem(), SslNegotiationPolicyMap{})
   405  	pulumi.RegisterOutputType(SslNegotiationPolicyOutput{})
   406  	pulumi.RegisterOutputType(SslNegotiationPolicyArrayOutput{})
   407  	pulumi.RegisterOutputType(SslNegotiationPolicyMapOutput{})
   408  }