github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/redshiftserverless/customDomainAssociation.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 redshiftserverless
     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  // Resource for managing an AWS Redshift Serverless Custom Domain Association.
    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/acm"
    26  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/redshiftserverless"
    27  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    28  //
    29  // )
    30  //
    31  //	func main() {
    32  //		pulumi.Run(func(ctx *pulumi.Context) error {
    33  //			example, err := acm.NewCertificate(ctx, "example", &acm.CertificateArgs{
    34  //				DomainName: pulumi.String("example.com"),
    35  //			})
    36  //			if err != nil {
    37  //				return err
    38  //			}
    39  //			exampleNamespace, err := redshiftserverless.NewNamespace(ctx, "example", &redshiftserverless.NamespaceArgs{
    40  //				NamespaceName: pulumi.String("example-namespace"),
    41  //			})
    42  //			if err != nil {
    43  //				return err
    44  //			}
    45  //			exampleWorkgroup, err := redshiftserverless.NewWorkgroup(ctx, "example", &redshiftserverless.WorkgroupArgs{
    46  //				WorkgroupName: pulumi.String("example-workgroup"),
    47  //				NamespaceName: exampleNamespace.NamespaceName,
    48  //			})
    49  //			if err != nil {
    50  //				return err
    51  //			}
    52  //			_, err = redshiftserverless.NewCustomDomainAssociation(ctx, "example", &redshiftserverless.CustomDomainAssociationArgs{
    53  //				WorkgroupName:              exampleWorkgroup.WorkgroupName,
    54  //				CustomDomainName:           pulumi.String("example.com"),
    55  //				CustomDomainCertificateArn: example.Arn,
    56  //			})
    57  //			if err != nil {
    58  //				return err
    59  //			}
    60  //			return nil
    61  //		})
    62  //	}
    63  //
    64  // ```
    65  // <!--End PulumiCodeChooser -->
    66  //
    67  // ## Import
    68  //
    69  // Using `pulumi import`, import Redshift Serverless Custom Domain Association using the `workgroup_name` and `custom_domain_name`, separated by the coma. For example:
    70  //
    71  // ```sh
    72  // $ pulumi import aws:redshiftserverless/customDomainAssociation:CustomDomainAssociation example example-workgroup,example.com
    73  // ```
    74  type CustomDomainAssociation struct {
    75  	pulumi.CustomResourceState
    76  
    77  	// ARN of the certificate for the custom domain association.
    78  	CustomDomainCertificateArn pulumi.StringOutput `pulumi:"customDomainCertificateArn"`
    79  	// Expiration time for the certificate.
    80  	CustomDomainCertificateExpiryTime pulumi.StringOutput `pulumi:"customDomainCertificateExpiryTime"`
    81  	// Custom domain to associate with the workgroup.
    82  	CustomDomainName pulumi.StringOutput `pulumi:"customDomainName"`
    83  	// Name of the workgroup.
    84  	WorkgroupName pulumi.StringOutput `pulumi:"workgroupName"`
    85  }
    86  
    87  // NewCustomDomainAssociation registers a new resource with the given unique name, arguments, and options.
    88  func NewCustomDomainAssociation(ctx *pulumi.Context,
    89  	name string, args *CustomDomainAssociationArgs, opts ...pulumi.ResourceOption) (*CustomDomainAssociation, error) {
    90  	if args == nil {
    91  		return nil, errors.New("missing one or more required arguments")
    92  	}
    93  
    94  	if args.CustomDomainCertificateArn == nil {
    95  		return nil, errors.New("invalid value for required argument 'CustomDomainCertificateArn'")
    96  	}
    97  	if args.CustomDomainName == nil {
    98  		return nil, errors.New("invalid value for required argument 'CustomDomainName'")
    99  	}
   100  	if args.WorkgroupName == nil {
   101  		return nil, errors.New("invalid value for required argument 'WorkgroupName'")
   102  	}
   103  	opts = internal.PkgResourceDefaultOpts(opts)
   104  	var resource CustomDomainAssociation
   105  	err := ctx.RegisterResource("aws:redshiftserverless/customDomainAssociation:CustomDomainAssociation", name, args, &resource, opts...)
   106  	if err != nil {
   107  		return nil, err
   108  	}
   109  	return &resource, nil
   110  }
   111  
   112  // GetCustomDomainAssociation gets an existing CustomDomainAssociation resource's state with the given name, ID, and optional
   113  // state properties that are used to uniquely qualify the lookup (nil if not required).
   114  func GetCustomDomainAssociation(ctx *pulumi.Context,
   115  	name string, id pulumi.IDInput, state *CustomDomainAssociationState, opts ...pulumi.ResourceOption) (*CustomDomainAssociation, error) {
   116  	var resource CustomDomainAssociation
   117  	err := ctx.ReadResource("aws:redshiftserverless/customDomainAssociation:CustomDomainAssociation", name, id, state, &resource, opts...)
   118  	if err != nil {
   119  		return nil, err
   120  	}
   121  	return &resource, nil
   122  }
   123  
   124  // Input properties used for looking up and filtering CustomDomainAssociation resources.
   125  type customDomainAssociationState struct {
   126  	// ARN of the certificate for the custom domain association.
   127  	CustomDomainCertificateArn *string `pulumi:"customDomainCertificateArn"`
   128  	// Expiration time for the certificate.
   129  	CustomDomainCertificateExpiryTime *string `pulumi:"customDomainCertificateExpiryTime"`
   130  	// Custom domain to associate with the workgroup.
   131  	CustomDomainName *string `pulumi:"customDomainName"`
   132  	// Name of the workgroup.
   133  	WorkgroupName *string `pulumi:"workgroupName"`
   134  }
   135  
   136  type CustomDomainAssociationState struct {
   137  	// ARN of the certificate for the custom domain association.
   138  	CustomDomainCertificateArn pulumi.StringPtrInput
   139  	// Expiration time for the certificate.
   140  	CustomDomainCertificateExpiryTime pulumi.StringPtrInput
   141  	// Custom domain to associate with the workgroup.
   142  	CustomDomainName pulumi.StringPtrInput
   143  	// Name of the workgroup.
   144  	WorkgroupName pulumi.StringPtrInput
   145  }
   146  
   147  func (CustomDomainAssociationState) ElementType() reflect.Type {
   148  	return reflect.TypeOf((*customDomainAssociationState)(nil)).Elem()
   149  }
   150  
   151  type customDomainAssociationArgs struct {
   152  	// ARN of the certificate for the custom domain association.
   153  	CustomDomainCertificateArn string `pulumi:"customDomainCertificateArn"`
   154  	// Custom domain to associate with the workgroup.
   155  	CustomDomainName string `pulumi:"customDomainName"`
   156  	// Name of the workgroup.
   157  	WorkgroupName string `pulumi:"workgroupName"`
   158  }
   159  
   160  // The set of arguments for constructing a CustomDomainAssociation resource.
   161  type CustomDomainAssociationArgs struct {
   162  	// ARN of the certificate for the custom domain association.
   163  	CustomDomainCertificateArn pulumi.StringInput
   164  	// Custom domain to associate with the workgroup.
   165  	CustomDomainName pulumi.StringInput
   166  	// Name of the workgroup.
   167  	WorkgroupName pulumi.StringInput
   168  }
   169  
   170  func (CustomDomainAssociationArgs) ElementType() reflect.Type {
   171  	return reflect.TypeOf((*customDomainAssociationArgs)(nil)).Elem()
   172  }
   173  
   174  type CustomDomainAssociationInput interface {
   175  	pulumi.Input
   176  
   177  	ToCustomDomainAssociationOutput() CustomDomainAssociationOutput
   178  	ToCustomDomainAssociationOutputWithContext(ctx context.Context) CustomDomainAssociationOutput
   179  }
   180  
   181  func (*CustomDomainAssociation) ElementType() reflect.Type {
   182  	return reflect.TypeOf((**CustomDomainAssociation)(nil)).Elem()
   183  }
   184  
   185  func (i *CustomDomainAssociation) ToCustomDomainAssociationOutput() CustomDomainAssociationOutput {
   186  	return i.ToCustomDomainAssociationOutputWithContext(context.Background())
   187  }
   188  
   189  func (i *CustomDomainAssociation) ToCustomDomainAssociationOutputWithContext(ctx context.Context) CustomDomainAssociationOutput {
   190  	return pulumi.ToOutputWithContext(ctx, i).(CustomDomainAssociationOutput)
   191  }
   192  
   193  // CustomDomainAssociationArrayInput is an input type that accepts CustomDomainAssociationArray and CustomDomainAssociationArrayOutput values.
   194  // You can construct a concrete instance of `CustomDomainAssociationArrayInput` via:
   195  //
   196  //	CustomDomainAssociationArray{ CustomDomainAssociationArgs{...} }
   197  type CustomDomainAssociationArrayInput interface {
   198  	pulumi.Input
   199  
   200  	ToCustomDomainAssociationArrayOutput() CustomDomainAssociationArrayOutput
   201  	ToCustomDomainAssociationArrayOutputWithContext(context.Context) CustomDomainAssociationArrayOutput
   202  }
   203  
   204  type CustomDomainAssociationArray []CustomDomainAssociationInput
   205  
   206  func (CustomDomainAssociationArray) ElementType() reflect.Type {
   207  	return reflect.TypeOf((*[]*CustomDomainAssociation)(nil)).Elem()
   208  }
   209  
   210  func (i CustomDomainAssociationArray) ToCustomDomainAssociationArrayOutput() CustomDomainAssociationArrayOutput {
   211  	return i.ToCustomDomainAssociationArrayOutputWithContext(context.Background())
   212  }
   213  
   214  func (i CustomDomainAssociationArray) ToCustomDomainAssociationArrayOutputWithContext(ctx context.Context) CustomDomainAssociationArrayOutput {
   215  	return pulumi.ToOutputWithContext(ctx, i).(CustomDomainAssociationArrayOutput)
   216  }
   217  
   218  // CustomDomainAssociationMapInput is an input type that accepts CustomDomainAssociationMap and CustomDomainAssociationMapOutput values.
   219  // You can construct a concrete instance of `CustomDomainAssociationMapInput` via:
   220  //
   221  //	CustomDomainAssociationMap{ "key": CustomDomainAssociationArgs{...} }
   222  type CustomDomainAssociationMapInput interface {
   223  	pulumi.Input
   224  
   225  	ToCustomDomainAssociationMapOutput() CustomDomainAssociationMapOutput
   226  	ToCustomDomainAssociationMapOutputWithContext(context.Context) CustomDomainAssociationMapOutput
   227  }
   228  
   229  type CustomDomainAssociationMap map[string]CustomDomainAssociationInput
   230  
   231  func (CustomDomainAssociationMap) ElementType() reflect.Type {
   232  	return reflect.TypeOf((*map[string]*CustomDomainAssociation)(nil)).Elem()
   233  }
   234  
   235  func (i CustomDomainAssociationMap) ToCustomDomainAssociationMapOutput() CustomDomainAssociationMapOutput {
   236  	return i.ToCustomDomainAssociationMapOutputWithContext(context.Background())
   237  }
   238  
   239  func (i CustomDomainAssociationMap) ToCustomDomainAssociationMapOutputWithContext(ctx context.Context) CustomDomainAssociationMapOutput {
   240  	return pulumi.ToOutputWithContext(ctx, i).(CustomDomainAssociationMapOutput)
   241  }
   242  
   243  type CustomDomainAssociationOutput struct{ *pulumi.OutputState }
   244  
   245  func (CustomDomainAssociationOutput) ElementType() reflect.Type {
   246  	return reflect.TypeOf((**CustomDomainAssociation)(nil)).Elem()
   247  }
   248  
   249  func (o CustomDomainAssociationOutput) ToCustomDomainAssociationOutput() CustomDomainAssociationOutput {
   250  	return o
   251  }
   252  
   253  func (o CustomDomainAssociationOutput) ToCustomDomainAssociationOutputWithContext(ctx context.Context) CustomDomainAssociationOutput {
   254  	return o
   255  }
   256  
   257  // ARN of the certificate for the custom domain association.
   258  func (o CustomDomainAssociationOutput) CustomDomainCertificateArn() pulumi.StringOutput {
   259  	return o.ApplyT(func(v *CustomDomainAssociation) pulumi.StringOutput { return v.CustomDomainCertificateArn }).(pulumi.StringOutput)
   260  }
   261  
   262  // Expiration time for the certificate.
   263  func (o CustomDomainAssociationOutput) CustomDomainCertificateExpiryTime() pulumi.StringOutput {
   264  	return o.ApplyT(func(v *CustomDomainAssociation) pulumi.StringOutput { return v.CustomDomainCertificateExpiryTime }).(pulumi.StringOutput)
   265  }
   266  
   267  // Custom domain to associate with the workgroup.
   268  func (o CustomDomainAssociationOutput) CustomDomainName() pulumi.StringOutput {
   269  	return o.ApplyT(func(v *CustomDomainAssociation) pulumi.StringOutput { return v.CustomDomainName }).(pulumi.StringOutput)
   270  }
   271  
   272  // Name of the workgroup.
   273  func (o CustomDomainAssociationOutput) WorkgroupName() pulumi.StringOutput {
   274  	return o.ApplyT(func(v *CustomDomainAssociation) pulumi.StringOutput { return v.WorkgroupName }).(pulumi.StringOutput)
   275  }
   276  
   277  type CustomDomainAssociationArrayOutput struct{ *pulumi.OutputState }
   278  
   279  func (CustomDomainAssociationArrayOutput) ElementType() reflect.Type {
   280  	return reflect.TypeOf((*[]*CustomDomainAssociation)(nil)).Elem()
   281  }
   282  
   283  func (o CustomDomainAssociationArrayOutput) ToCustomDomainAssociationArrayOutput() CustomDomainAssociationArrayOutput {
   284  	return o
   285  }
   286  
   287  func (o CustomDomainAssociationArrayOutput) ToCustomDomainAssociationArrayOutputWithContext(ctx context.Context) CustomDomainAssociationArrayOutput {
   288  	return o
   289  }
   290  
   291  func (o CustomDomainAssociationArrayOutput) Index(i pulumi.IntInput) CustomDomainAssociationOutput {
   292  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CustomDomainAssociation {
   293  		return vs[0].([]*CustomDomainAssociation)[vs[1].(int)]
   294  	}).(CustomDomainAssociationOutput)
   295  }
   296  
   297  type CustomDomainAssociationMapOutput struct{ *pulumi.OutputState }
   298  
   299  func (CustomDomainAssociationMapOutput) ElementType() reflect.Type {
   300  	return reflect.TypeOf((*map[string]*CustomDomainAssociation)(nil)).Elem()
   301  }
   302  
   303  func (o CustomDomainAssociationMapOutput) ToCustomDomainAssociationMapOutput() CustomDomainAssociationMapOutput {
   304  	return o
   305  }
   306  
   307  func (o CustomDomainAssociationMapOutput) ToCustomDomainAssociationMapOutputWithContext(ctx context.Context) CustomDomainAssociationMapOutput {
   308  	return o
   309  }
   310  
   311  func (o CustomDomainAssociationMapOutput) MapIndex(k pulumi.StringInput) CustomDomainAssociationOutput {
   312  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CustomDomainAssociation {
   313  		return vs[0].(map[string]*CustomDomainAssociation)[vs[1].(string)]
   314  	}).(CustomDomainAssociationOutput)
   315  }
   316  
   317  func init() {
   318  	pulumi.RegisterInputType(reflect.TypeOf((*CustomDomainAssociationInput)(nil)).Elem(), &CustomDomainAssociation{})
   319  	pulumi.RegisterInputType(reflect.TypeOf((*CustomDomainAssociationArrayInput)(nil)).Elem(), CustomDomainAssociationArray{})
   320  	pulumi.RegisterInputType(reflect.TypeOf((*CustomDomainAssociationMapInput)(nil)).Elem(), CustomDomainAssociationMap{})
   321  	pulumi.RegisterOutputType(CustomDomainAssociationOutput{})
   322  	pulumi.RegisterOutputType(CustomDomainAssociationArrayOutput{})
   323  	pulumi.RegisterOutputType(CustomDomainAssociationMapOutput{})
   324  }