github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/quicksight/template.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 quicksight
     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 a QuickSight Template.
    16  //
    17  // ## Example Usage
    18  //
    19  // ### From Source Template
    20  //
    21  // <!--Start PulumiCodeChooser -->
    22  // ```go
    23  // package main
    24  //
    25  // import (
    26  //
    27  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/quicksight"
    28  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    29  //
    30  // )
    31  //
    32  //	func main() {
    33  //		pulumi.Run(func(ctx *pulumi.Context) error {
    34  //			_, err := quicksight.NewTemplate(ctx, "example", &quicksight.TemplateArgs{
    35  //				TemplateId:         pulumi.String("example-id"),
    36  //				Name:               pulumi.String("example-name"),
    37  //				VersionDescription: pulumi.String("version"),
    38  //				SourceEntity: &quicksight.TemplateSourceEntityArgs{
    39  //					SourceTemplate: &quicksight.TemplateSourceEntitySourceTemplateArgs{
    40  //						Arn: pulumi.Any(source.Arn),
    41  //					},
    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 a QuickSight Template using the AWS account ID and template ID separated by a comma (`,`). For example:
    57  //
    58  // ```sh
    59  // $ pulumi import aws:quicksight/template:Template example 123456789012,example-id
    60  // ```
    61  type Template struct {
    62  	pulumi.CustomResourceState
    63  
    64  	// The Amazon Resource Name (ARN) of the resource.
    65  	Arn pulumi.StringOutput `pulumi:"arn"`
    66  	// AWS account ID.
    67  	AwsAccountId pulumi.StringOutput `pulumi:"awsAccountId"`
    68  	// The time that the template was created.
    69  	CreatedTime pulumi.StringOutput `pulumi:"createdTime"`
    70  	// The time that the template was last updated.
    71  	LastUpdatedTime pulumi.StringOutput `pulumi:"lastUpdatedTime"`
    72  	// Display name for the template.
    73  	Name pulumi.StringOutput `pulumi:"name"`
    74  	// A set of resource permissions on the template. Maximum of 64 items. See permissions.
    75  	Permissions TemplatePermissionArrayOutput `pulumi:"permissions"`
    76  	// The entity that you are using as a source when you create the template (analysis or template). Only one of `definition` or `sourceEntity` should be configured. See source_entity.
    77  	SourceEntity TemplateSourceEntityPtrOutput `pulumi:"sourceEntity"`
    78  	// Amazon Resource Name (ARN) of an analysis or template that was used to create this template.
    79  	SourceEntityArn pulumi.StringOutput `pulumi:"sourceEntityArn"`
    80  	// The template creation status.
    81  	Status pulumi.StringOutput `pulumi:"status"`
    82  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    83  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    84  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    85  	//
    86  	// Deprecated: Please use `tags` instead.
    87  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    88  	// Identifier for the template.
    89  	TemplateId pulumi.StringOutput `pulumi:"templateId"`
    90  	// A description of the current template version being created/updated.
    91  	//
    92  	// The following arguments are optional:
    93  	VersionDescription pulumi.StringOutput `pulumi:"versionDescription"`
    94  	// The version number of the template version.
    95  	VersionNumber pulumi.IntOutput `pulumi:"versionNumber"`
    96  }
    97  
    98  // NewTemplate registers a new resource with the given unique name, arguments, and options.
    99  func NewTemplate(ctx *pulumi.Context,
   100  	name string, args *TemplateArgs, opts ...pulumi.ResourceOption) (*Template, error) {
   101  	if args == nil {
   102  		return nil, errors.New("missing one or more required arguments")
   103  	}
   104  
   105  	if args.TemplateId == nil {
   106  		return nil, errors.New("invalid value for required argument 'TemplateId'")
   107  	}
   108  	if args.VersionDescription == nil {
   109  		return nil, errors.New("invalid value for required argument 'VersionDescription'")
   110  	}
   111  	opts = internal.PkgResourceDefaultOpts(opts)
   112  	var resource Template
   113  	err := ctx.RegisterResource("aws:quicksight/template:Template", name, args, &resource, opts...)
   114  	if err != nil {
   115  		return nil, err
   116  	}
   117  	return &resource, nil
   118  }
   119  
   120  // GetTemplate gets an existing Template resource's state with the given name, ID, and optional
   121  // state properties that are used to uniquely qualify the lookup (nil if not required).
   122  func GetTemplate(ctx *pulumi.Context,
   123  	name string, id pulumi.IDInput, state *TemplateState, opts ...pulumi.ResourceOption) (*Template, error) {
   124  	var resource Template
   125  	err := ctx.ReadResource("aws:quicksight/template:Template", name, id, state, &resource, opts...)
   126  	if err != nil {
   127  		return nil, err
   128  	}
   129  	return &resource, nil
   130  }
   131  
   132  // Input properties used for looking up and filtering Template resources.
   133  type templateState struct {
   134  	// The Amazon Resource Name (ARN) of the resource.
   135  	Arn *string `pulumi:"arn"`
   136  	// AWS account ID.
   137  	AwsAccountId *string `pulumi:"awsAccountId"`
   138  	// The time that the template was created.
   139  	CreatedTime *string `pulumi:"createdTime"`
   140  	// The time that the template was last updated.
   141  	LastUpdatedTime *string `pulumi:"lastUpdatedTime"`
   142  	// Display name for the template.
   143  	Name *string `pulumi:"name"`
   144  	// A set of resource permissions on the template. Maximum of 64 items. See permissions.
   145  	Permissions []TemplatePermission `pulumi:"permissions"`
   146  	// The entity that you are using as a source when you create the template (analysis or template). Only one of `definition` or `sourceEntity` should be configured. See source_entity.
   147  	SourceEntity *TemplateSourceEntity `pulumi:"sourceEntity"`
   148  	// Amazon Resource Name (ARN) of an analysis or template that was used to create this template.
   149  	SourceEntityArn *string `pulumi:"sourceEntityArn"`
   150  	// The template creation status.
   151  	Status *string `pulumi:"status"`
   152  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   153  	Tags map[string]string `pulumi:"tags"`
   154  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   155  	//
   156  	// Deprecated: Please use `tags` instead.
   157  	TagsAll map[string]string `pulumi:"tagsAll"`
   158  	// Identifier for the template.
   159  	TemplateId *string `pulumi:"templateId"`
   160  	// A description of the current template version being created/updated.
   161  	//
   162  	// The following arguments are optional:
   163  	VersionDescription *string `pulumi:"versionDescription"`
   164  	// The version number of the template version.
   165  	VersionNumber *int `pulumi:"versionNumber"`
   166  }
   167  
   168  type TemplateState struct {
   169  	// The Amazon Resource Name (ARN) of the resource.
   170  	Arn pulumi.StringPtrInput
   171  	// AWS account ID.
   172  	AwsAccountId pulumi.StringPtrInput
   173  	// The time that the template was created.
   174  	CreatedTime pulumi.StringPtrInput
   175  	// The time that the template was last updated.
   176  	LastUpdatedTime pulumi.StringPtrInput
   177  	// Display name for the template.
   178  	Name pulumi.StringPtrInput
   179  	// A set of resource permissions on the template. Maximum of 64 items. See permissions.
   180  	Permissions TemplatePermissionArrayInput
   181  	// The entity that you are using as a source when you create the template (analysis or template). Only one of `definition` or `sourceEntity` should be configured. See source_entity.
   182  	SourceEntity TemplateSourceEntityPtrInput
   183  	// Amazon Resource Name (ARN) of an analysis or template that was used to create this template.
   184  	SourceEntityArn pulumi.StringPtrInput
   185  	// The template creation status.
   186  	Status pulumi.StringPtrInput
   187  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   188  	Tags pulumi.StringMapInput
   189  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   190  	//
   191  	// Deprecated: Please use `tags` instead.
   192  	TagsAll pulumi.StringMapInput
   193  	// Identifier for the template.
   194  	TemplateId pulumi.StringPtrInput
   195  	// A description of the current template version being created/updated.
   196  	//
   197  	// The following arguments are optional:
   198  	VersionDescription pulumi.StringPtrInput
   199  	// The version number of the template version.
   200  	VersionNumber pulumi.IntPtrInput
   201  }
   202  
   203  func (TemplateState) ElementType() reflect.Type {
   204  	return reflect.TypeOf((*templateState)(nil)).Elem()
   205  }
   206  
   207  type templateArgs struct {
   208  	// AWS account ID.
   209  	AwsAccountId *string `pulumi:"awsAccountId"`
   210  	// Display name for the template.
   211  	Name *string `pulumi:"name"`
   212  	// A set of resource permissions on the template. Maximum of 64 items. See permissions.
   213  	Permissions []TemplatePermission `pulumi:"permissions"`
   214  	// The entity that you are using as a source when you create the template (analysis or template). Only one of `definition` or `sourceEntity` should be configured. See source_entity.
   215  	SourceEntity *TemplateSourceEntity `pulumi:"sourceEntity"`
   216  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   217  	Tags map[string]string `pulumi:"tags"`
   218  	// Identifier for the template.
   219  	TemplateId string `pulumi:"templateId"`
   220  	// A description of the current template version being created/updated.
   221  	//
   222  	// The following arguments are optional:
   223  	VersionDescription string `pulumi:"versionDescription"`
   224  }
   225  
   226  // The set of arguments for constructing a Template resource.
   227  type TemplateArgs struct {
   228  	// AWS account ID.
   229  	AwsAccountId pulumi.StringPtrInput
   230  	// Display name for the template.
   231  	Name pulumi.StringPtrInput
   232  	// A set of resource permissions on the template. Maximum of 64 items. See permissions.
   233  	Permissions TemplatePermissionArrayInput
   234  	// The entity that you are using as a source when you create the template (analysis or template). Only one of `definition` or `sourceEntity` should be configured. See source_entity.
   235  	SourceEntity TemplateSourceEntityPtrInput
   236  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   237  	Tags pulumi.StringMapInput
   238  	// Identifier for the template.
   239  	TemplateId pulumi.StringInput
   240  	// A description of the current template version being created/updated.
   241  	//
   242  	// The following arguments are optional:
   243  	VersionDescription pulumi.StringInput
   244  }
   245  
   246  func (TemplateArgs) ElementType() reflect.Type {
   247  	return reflect.TypeOf((*templateArgs)(nil)).Elem()
   248  }
   249  
   250  type TemplateInput interface {
   251  	pulumi.Input
   252  
   253  	ToTemplateOutput() TemplateOutput
   254  	ToTemplateOutputWithContext(ctx context.Context) TemplateOutput
   255  }
   256  
   257  func (*Template) ElementType() reflect.Type {
   258  	return reflect.TypeOf((**Template)(nil)).Elem()
   259  }
   260  
   261  func (i *Template) ToTemplateOutput() TemplateOutput {
   262  	return i.ToTemplateOutputWithContext(context.Background())
   263  }
   264  
   265  func (i *Template) ToTemplateOutputWithContext(ctx context.Context) TemplateOutput {
   266  	return pulumi.ToOutputWithContext(ctx, i).(TemplateOutput)
   267  }
   268  
   269  // TemplateArrayInput is an input type that accepts TemplateArray and TemplateArrayOutput values.
   270  // You can construct a concrete instance of `TemplateArrayInput` via:
   271  //
   272  //	TemplateArray{ TemplateArgs{...} }
   273  type TemplateArrayInput interface {
   274  	pulumi.Input
   275  
   276  	ToTemplateArrayOutput() TemplateArrayOutput
   277  	ToTemplateArrayOutputWithContext(context.Context) TemplateArrayOutput
   278  }
   279  
   280  type TemplateArray []TemplateInput
   281  
   282  func (TemplateArray) ElementType() reflect.Type {
   283  	return reflect.TypeOf((*[]*Template)(nil)).Elem()
   284  }
   285  
   286  func (i TemplateArray) ToTemplateArrayOutput() TemplateArrayOutput {
   287  	return i.ToTemplateArrayOutputWithContext(context.Background())
   288  }
   289  
   290  func (i TemplateArray) ToTemplateArrayOutputWithContext(ctx context.Context) TemplateArrayOutput {
   291  	return pulumi.ToOutputWithContext(ctx, i).(TemplateArrayOutput)
   292  }
   293  
   294  // TemplateMapInput is an input type that accepts TemplateMap and TemplateMapOutput values.
   295  // You can construct a concrete instance of `TemplateMapInput` via:
   296  //
   297  //	TemplateMap{ "key": TemplateArgs{...} }
   298  type TemplateMapInput interface {
   299  	pulumi.Input
   300  
   301  	ToTemplateMapOutput() TemplateMapOutput
   302  	ToTemplateMapOutputWithContext(context.Context) TemplateMapOutput
   303  }
   304  
   305  type TemplateMap map[string]TemplateInput
   306  
   307  func (TemplateMap) ElementType() reflect.Type {
   308  	return reflect.TypeOf((*map[string]*Template)(nil)).Elem()
   309  }
   310  
   311  func (i TemplateMap) ToTemplateMapOutput() TemplateMapOutput {
   312  	return i.ToTemplateMapOutputWithContext(context.Background())
   313  }
   314  
   315  func (i TemplateMap) ToTemplateMapOutputWithContext(ctx context.Context) TemplateMapOutput {
   316  	return pulumi.ToOutputWithContext(ctx, i).(TemplateMapOutput)
   317  }
   318  
   319  type TemplateOutput struct{ *pulumi.OutputState }
   320  
   321  func (TemplateOutput) ElementType() reflect.Type {
   322  	return reflect.TypeOf((**Template)(nil)).Elem()
   323  }
   324  
   325  func (o TemplateOutput) ToTemplateOutput() TemplateOutput {
   326  	return o
   327  }
   328  
   329  func (o TemplateOutput) ToTemplateOutputWithContext(ctx context.Context) TemplateOutput {
   330  	return o
   331  }
   332  
   333  // The Amazon Resource Name (ARN) of the resource.
   334  func (o TemplateOutput) Arn() pulumi.StringOutput {
   335  	return o.ApplyT(func(v *Template) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   336  }
   337  
   338  // AWS account ID.
   339  func (o TemplateOutput) AwsAccountId() pulumi.StringOutput {
   340  	return o.ApplyT(func(v *Template) pulumi.StringOutput { return v.AwsAccountId }).(pulumi.StringOutput)
   341  }
   342  
   343  // The time that the template was created.
   344  func (o TemplateOutput) CreatedTime() pulumi.StringOutput {
   345  	return o.ApplyT(func(v *Template) pulumi.StringOutput { return v.CreatedTime }).(pulumi.StringOutput)
   346  }
   347  
   348  // The time that the template was last updated.
   349  func (o TemplateOutput) LastUpdatedTime() pulumi.StringOutput {
   350  	return o.ApplyT(func(v *Template) pulumi.StringOutput { return v.LastUpdatedTime }).(pulumi.StringOutput)
   351  }
   352  
   353  // Display name for the template.
   354  func (o TemplateOutput) Name() pulumi.StringOutput {
   355  	return o.ApplyT(func(v *Template) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   356  }
   357  
   358  // A set of resource permissions on the template. Maximum of 64 items. See permissions.
   359  func (o TemplateOutput) Permissions() TemplatePermissionArrayOutput {
   360  	return o.ApplyT(func(v *Template) TemplatePermissionArrayOutput { return v.Permissions }).(TemplatePermissionArrayOutput)
   361  }
   362  
   363  // The entity that you are using as a source when you create the template (analysis or template). Only one of `definition` or `sourceEntity` should be configured. See source_entity.
   364  func (o TemplateOutput) SourceEntity() TemplateSourceEntityPtrOutput {
   365  	return o.ApplyT(func(v *Template) TemplateSourceEntityPtrOutput { return v.SourceEntity }).(TemplateSourceEntityPtrOutput)
   366  }
   367  
   368  // Amazon Resource Name (ARN) of an analysis or template that was used to create this template.
   369  func (o TemplateOutput) SourceEntityArn() pulumi.StringOutput {
   370  	return o.ApplyT(func(v *Template) pulumi.StringOutput { return v.SourceEntityArn }).(pulumi.StringOutput)
   371  }
   372  
   373  // The template creation status.
   374  func (o TemplateOutput) Status() pulumi.StringOutput {
   375  	return o.ApplyT(func(v *Template) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
   376  }
   377  
   378  // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   379  func (o TemplateOutput) Tags() pulumi.StringMapOutput {
   380  	return o.ApplyT(func(v *Template) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   381  }
   382  
   383  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   384  //
   385  // Deprecated: Please use `tags` instead.
   386  func (o TemplateOutput) TagsAll() pulumi.StringMapOutput {
   387  	return o.ApplyT(func(v *Template) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   388  }
   389  
   390  // Identifier for the template.
   391  func (o TemplateOutput) TemplateId() pulumi.StringOutput {
   392  	return o.ApplyT(func(v *Template) pulumi.StringOutput { return v.TemplateId }).(pulumi.StringOutput)
   393  }
   394  
   395  // A description of the current template version being created/updated.
   396  //
   397  // The following arguments are optional:
   398  func (o TemplateOutput) VersionDescription() pulumi.StringOutput {
   399  	return o.ApplyT(func(v *Template) pulumi.StringOutput { return v.VersionDescription }).(pulumi.StringOutput)
   400  }
   401  
   402  // The version number of the template version.
   403  func (o TemplateOutput) VersionNumber() pulumi.IntOutput {
   404  	return o.ApplyT(func(v *Template) pulumi.IntOutput { return v.VersionNumber }).(pulumi.IntOutput)
   405  }
   406  
   407  type TemplateArrayOutput struct{ *pulumi.OutputState }
   408  
   409  func (TemplateArrayOutput) ElementType() reflect.Type {
   410  	return reflect.TypeOf((*[]*Template)(nil)).Elem()
   411  }
   412  
   413  func (o TemplateArrayOutput) ToTemplateArrayOutput() TemplateArrayOutput {
   414  	return o
   415  }
   416  
   417  func (o TemplateArrayOutput) ToTemplateArrayOutputWithContext(ctx context.Context) TemplateArrayOutput {
   418  	return o
   419  }
   420  
   421  func (o TemplateArrayOutput) Index(i pulumi.IntInput) TemplateOutput {
   422  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Template {
   423  		return vs[0].([]*Template)[vs[1].(int)]
   424  	}).(TemplateOutput)
   425  }
   426  
   427  type TemplateMapOutput struct{ *pulumi.OutputState }
   428  
   429  func (TemplateMapOutput) ElementType() reflect.Type {
   430  	return reflect.TypeOf((*map[string]*Template)(nil)).Elem()
   431  }
   432  
   433  func (o TemplateMapOutput) ToTemplateMapOutput() TemplateMapOutput {
   434  	return o
   435  }
   436  
   437  func (o TemplateMapOutput) ToTemplateMapOutputWithContext(ctx context.Context) TemplateMapOutput {
   438  	return o
   439  }
   440  
   441  func (o TemplateMapOutput) MapIndex(k pulumi.StringInput) TemplateOutput {
   442  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Template {
   443  		return vs[0].(map[string]*Template)[vs[1].(string)]
   444  	}).(TemplateOutput)
   445  }
   446  
   447  func init() {
   448  	pulumi.RegisterInputType(reflect.TypeOf((*TemplateInput)(nil)).Elem(), &Template{})
   449  	pulumi.RegisterInputType(reflect.TypeOf((*TemplateArrayInput)(nil)).Elem(), TemplateArray{})
   450  	pulumi.RegisterInputType(reflect.TypeOf((*TemplateMapInput)(nil)).Elem(), TemplateMap{})
   451  	pulumi.RegisterOutputType(TemplateOutput{})
   452  	pulumi.RegisterOutputType(TemplateArrayOutput{})
   453  	pulumi.RegisterOutputType(TemplateMapOutput{})
   454  }