github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/athena/workgroup.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 athena
     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  // Provides an Athena Workgroup.
    15  //
    16  // ## Example Usage
    17  //
    18  // <!--Start PulumiCodeChooser -->
    19  // ```go
    20  // package main
    21  //
    22  // import (
    23  //
    24  //	"fmt"
    25  //
    26  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/athena"
    27  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    28  //
    29  // )
    30  //
    31  //	func main() {
    32  //		pulumi.Run(func(ctx *pulumi.Context) error {
    33  //			_, err := athena.NewWorkgroup(ctx, "example", &athena.WorkgroupArgs{
    34  //				Name: pulumi.String("example"),
    35  //				Configuration: &athena.WorkgroupConfigurationArgs{
    36  //					EnforceWorkgroupConfiguration:   pulumi.Bool(true),
    37  //					PublishCloudwatchMetricsEnabled: pulumi.Bool(true),
    38  //					ResultConfiguration: &athena.WorkgroupConfigurationResultConfigurationArgs{
    39  //						OutputLocation: pulumi.String(fmt.Sprintf("s3://%v/output/", exampleAwsS3Bucket.Bucket)),
    40  //						EncryptionConfiguration: &athena.WorkgroupConfigurationResultConfigurationEncryptionConfigurationArgs{
    41  //							EncryptionOption: pulumi.String("SSE_KMS"),
    42  //							KmsKeyArn:        pulumi.Any(exampleAwsKmsKey.Arn),
    43  //						},
    44  //					},
    45  //				},
    46  //			})
    47  //			if err != nil {
    48  //				return err
    49  //			}
    50  //			return nil
    51  //		})
    52  //	}
    53  //
    54  // ```
    55  // <!--End PulumiCodeChooser -->
    56  //
    57  // ## Import
    58  //
    59  // Using `pulumi import`, import Athena Workgroups using their name. For example:
    60  //
    61  // ```sh
    62  // $ pulumi import aws:athena/workgroup:Workgroup example example
    63  // ```
    64  type Workgroup struct {
    65  	pulumi.CustomResourceState
    66  
    67  	// ARN of the workgroup
    68  	Arn pulumi.StringOutput `pulumi:"arn"`
    69  	// Configuration block with various settings for the workgroup. Documented below.
    70  	Configuration WorkgroupConfigurationPtrOutput `pulumi:"configuration"`
    71  	// Description of the workgroup.
    72  	Description pulumi.StringPtrOutput `pulumi:"description"`
    73  	// Option to delete the workgroup and its contents even if the workgroup contains any named queries.
    74  	ForceDestroy pulumi.BoolPtrOutput `pulumi:"forceDestroy"`
    75  	// Name of the workgroup.
    76  	Name pulumi.StringOutput `pulumi:"name"`
    77  	// State of the workgroup. Valid values are `DISABLED` or `ENABLED`. Defaults to `ENABLED`.
    78  	State pulumi.StringPtrOutput `pulumi:"state"`
    79  	// Key-value map of resource tags for the workgroup. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    80  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    81  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    82  	//
    83  	// Deprecated: Please use `tags` instead.
    84  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    85  }
    86  
    87  // NewWorkgroup registers a new resource with the given unique name, arguments, and options.
    88  func NewWorkgroup(ctx *pulumi.Context,
    89  	name string, args *WorkgroupArgs, opts ...pulumi.ResourceOption) (*Workgroup, error) {
    90  	if args == nil {
    91  		args = &WorkgroupArgs{}
    92  	}
    93  
    94  	opts = internal.PkgResourceDefaultOpts(opts)
    95  	var resource Workgroup
    96  	err := ctx.RegisterResource("aws:athena/workgroup:Workgroup", name, args, &resource, opts...)
    97  	if err != nil {
    98  		return nil, err
    99  	}
   100  	return &resource, nil
   101  }
   102  
   103  // GetWorkgroup gets an existing Workgroup resource's state with the given name, ID, and optional
   104  // state properties that are used to uniquely qualify the lookup (nil if not required).
   105  func GetWorkgroup(ctx *pulumi.Context,
   106  	name string, id pulumi.IDInput, state *WorkgroupState, opts ...pulumi.ResourceOption) (*Workgroup, error) {
   107  	var resource Workgroup
   108  	err := ctx.ReadResource("aws:athena/workgroup:Workgroup", name, id, state, &resource, opts...)
   109  	if err != nil {
   110  		return nil, err
   111  	}
   112  	return &resource, nil
   113  }
   114  
   115  // Input properties used for looking up and filtering Workgroup resources.
   116  type workgroupState struct {
   117  	// ARN of the workgroup
   118  	Arn *string `pulumi:"arn"`
   119  	// Configuration block with various settings for the workgroup. Documented below.
   120  	Configuration *WorkgroupConfiguration `pulumi:"configuration"`
   121  	// Description of the workgroup.
   122  	Description *string `pulumi:"description"`
   123  	// Option to delete the workgroup and its contents even if the workgroup contains any named queries.
   124  	ForceDestroy *bool `pulumi:"forceDestroy"`
   125  	// Name of the workgroup.
   126  	Name *string `pulumi:"name"`
   127  	// State of the workgroup. Valid values are `DISABLED` or `ENABLED`. Defaults to `ENABLED`.
   128  	State *string `pulumi:"state"`
   129  	// Key-value map of resource tags for the workgroup. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   130  	Tags map[string]string `pulumi:"tags"`
   131  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   132  	//
   133  	// Deprecated: Please use `tags` instead.
   134  	TagsAll map[string]string `pulumi:"tagsAll"`
   135  }
   136  
   137  type WorkgroupState struct {
   138  	// ARN of the workgroup
   139  	Arn pulumi.StringPtrInput
   140  	// Configuration block with various settings for the workgroup. Documented below.
   141  	Configuration WorkgroupConfigurationPtrInput
   142  	// Description of the workgroup.
   143  	Description pulumi.StringPtrInput
   144  	// Option to delete the workgroup and its contents even if the workgroup contains any named queries.
   145  	ForceDestroy pulumi.BoolPtrInput
   146  	// Name of the workgroup.
   147  	Name pulumi.StringPtrInput
   148  	// State of the workgroup. Valid values are `DISABLED` or `ENABLED`. Defaults to `ENABLED`.
   149  	State pulumi.StringPtrInput
   150  	// Key-value map of resource tags for the workgroup. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   151  	Tags pulumi.StringMapInput
   152  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   153  	//
   154  	// Deprecated: Please use `tags` instead.
   155  	TagsAll pulumi.StringMapInput
   156  }
   157  
   158  func (WorkgroupState) ElementType() reflect.Type {
   159  	return reflect.TypeOf((*workgroupState)(nil)).Elem()
   160  }
   161  
   162  type workgroupArgs struct {
   163  	// Configuration block with various settings for the workgroup. Documented below.
   164  	Configuration *WorkgroupConfiguration `pulumi:"configuration"`
   165  	// Description of the workgroup.
   166  	Description *string `pulumi:"description"`
   167  	// Option to delete the workgroup and its contents even if the workgroup contains any named queries.
   168  	ForceDestroy *bool `pulumi:"forceDestroy"`
   169  	// Name of the workgroup.
   170  	Name *string `pulumi:"name"`
   171  	// State of the workgroup. Valid values are `DISABLED` or `ENABLED`. Defaults to `ENABLED`.
   172  	State *string `pulumi:"state"`
   173  	// Key-value map of resource tags for the workgroup. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   174  	Tags map[string]string `pulumi:"tags"`
   175  }
   176  
   177  // The set of arguments for constructing a Workgroup resource.
   178  type WorkgroupArgs struct {
   179  	// Configuration block with various settings for the workgroup. Documented below.
   180  	Configuration WorkgroupConfigurationPtrInput
   181  	// Description of the workgroup.
   182  	Description pulumi.StringPtrInput
   183  	// Option to delete the workgroup and its contents even if the workgroup contains any named queries.
   184  	ForceDestroy pulumi.BoolPtrInput
   185  	// Name of the workgroup.
   186  	Name pulumi.StringPtrInput
   187  	// State of the workgroup. Valid values are `DISABLED` or `ENABLED`. Defaults to `ENABLED`.
   188  	State pulumi.StringPtrInput
   189  	// Key-value map of resource tags for the workgroup. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   190  	Tags pulumi.StringMapInput
   191  }
   192  
   193  func (WorkgroupArgs) ElementType() reflect.Type {
   194  	return reflect.TypeOf((*workgroupArgs)(nil)).Elem()
   195  }
   196  
   197  type WorkgroupInput interface {
   198  	pulumi.Input
   199  
   200  	ToWorkgroupOutput() WorkgroupOutput
   201  	ToWorkgroupOutputWithContext(ctx context.Context) WorkgroupOutput
   202  }
   203  
   204  func (*Workgroup) ElementType() reflect.Type {
   205  	return reflect.TypeOf((**Workgroup)(nil)).Elem()
   206  }
   207  
   208  func (i *Workgroup) ToWorkgroupOutput() WorkgroupOutput {
   209  	return i.ToWorkgroupOutputWithContext(context.Background())
   210  }
   211  
   212  func (i *Workgroup) ToWorkgroupOutputWithContext(ctx context.Context) WorkgroupOutput {
   213  	return pulumi.ToOutputWithContext(ctx, i).(WorkgroupOutput)
   214  }
   215  
   216  // WorkgroupArrayInput is an input type that accepts WorkgroupArray and WorkgroupArrayOutput values.
   217  // You can construct a concrete instance of `WorkgroupArrayInput` via:
   218  //
   219  //	WorkgroupArray{ WorkgroupArgs{...} }
   220  type WorkgroupArrayInput interface {
   221  	pulumi.Input
   222  
   223  	ToWorkgroupArrayOutput() WorkgroupArrayOutput
   224  	ToWorkgroupArrayOutputWithContext(context.Context) WorkgroupArrayOutput
   225  }
   226  
   227  type WorkgroupArray []WorkgroupInput
   228  
   229  func (WorkgroupArray) ElementType() reflect.Type {
   230  	return reflect.TypeOf((*[]*Workgroup)(nil)).Elem()
   231  }
   232  
   233  func (i WorkgroupArray) ToWorkgroupArrayOutput() WorkgroupArrayOutput {
   234  	return i.ToWorkgroupArrayOutputWithContext(context.Background())
   235  }
   236  
   237  func (i WorkgroupArray) ToWorkgroupArrayOutputWithContext(ctx context.Context) WorkgroupArrayOutput {
   238  	return pulumi.ToOutputWithContext(ctx, i).(WorkgroupArrayOutput)
   239  }
   240  
   241  // WorkgroupMapInput is an input type that accepts WorkgroupMap and WorkgroupMapOutput values.
   242  // You can construct a concrete instance of `WorkgroupMapInput` via:
   243  //
   244  //	WorkgroupMap{ "key": WorkgroupArgs{...} }
   245  type WorkgroupMapInput interface {
   246  	pulumi.Input
   247  
   248  	ToWorkgroupMapOutput() WorkgroupMapOutput
   249  	ToWorkgroupMapOutputWithContext(context.Context) WorkgroupMapOutput
   250  }
   251  
   252  type WorkgroupMap map[string]WorkgroupInput
   253  
   254  func (WorkgroupMap) ElementType() reflect.Type {
   255  	return reflect.TypeOf((*map[string]*Workgroup)(nil)).Elem()
   256  }
   257  
   258  func (i WorkgroupMap) ToWorkgroupMapOutput() WorkgroupMapOutput {
   259  	return i.ToWorkgroupMapOutputWithContext(context.Background())
   260  }
   261  
   262  func (i WorkgroupMap) ToWorkgroupMapOutputWithContext(ctx context.Context) WorkgroupMapOutput {
   263  	return pulumi.ToOutputWithContext(ctx, i).(WorkgroupMapOutput)
   264  }
   265  
   266  type WorkgroupOutput struct{ *pulumi.OutputState }
   267  
   268  func (WorkgroupOutput) ElementType() reflect.Type {
   269  	return reflect.TypeOf((**Workgroup)(nil)).Elem()
   270  }
   271  
   272  func (o WorkgroupOutput) ToWorkgroupOutput() WorkgroupOutput {
   273  	return o
   274  }
   275  
   276  func (o WorkgroupOutput) ToWorkgroupOutputWithContext(ctx context.Context) WorkgroupOutput {
   277  	return o
   278  }
   279  
   280  // ARN of the workgroup
   281  func (o WorkgroupOutput) Arn() pulumi.StringOutput {
   282  	return o.ApplyT(func(v *Workgroup) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   283  }
   284  
   285  // Configuration block with various settings for the workgroup. Documented below.
   286  func (o WorkgroupOutput) Configuration() WorkgroupConfigurationPtrOutput {
   287  	return o.ApplyT(func(v *Workgroup) WorkgroupConfigurationPtrOutput { return v.Configuration }).(WorkgroupConfigurationPtrOutput)
   288  }
   289  
   290  // Description of the workgroup.
   291  func (o WorkgroupOutput) Description() pulumi.StringPtrOutput {
   292  	return o.ApplyT(func(v *Workgroup) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   293  }
   294  
   295  // Option to delete the workgroup and its contents even if the workgroup contains any named queries.
   296  func (o WorkgroupOutput) ForceDestroy() pulumi.BoolPtrOutput {
   297  	return o.ApplyT(func(v *Workgroup) pulumi.BoolPtrOutput { return v.ForceDestroy }).(pulumi.BoolPtrOutput)
   298  }
   299  
   300  // Name of the workgroup.
   301  func (o WorkgroupOutput) Name() pulumi.StringOutput {
   302  	return o.ApplyT(func(v *Workgroup) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   303  }
   304  
   305  // State of the workgroup. Valid values are `DISABLED` or `ENABLED`. Defaults to `ENABLED`.
   306  func (o WorkgroupOutput) State() pulumi.StringPtrOutput {
   307  	return o.ApplyT(func(v *Workgroup) pulumi.StringPtrOutput { return v.State }).(pulumi.StringPtrOutput)
   308  }
   309  
   310  // Key-value map of resource tags for the workgroup. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   311  func (o WorkgroupOutput) Tags() pulumi.StringMapOutput {
   312  	return o.ApplyT(func(v *Workgroup) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   313  }
   314  
   315  // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   316  //
   317  // Deprecated: Please use `tags` instead.
   318  func (o WorkgroupOutput) TagsAll() pulumi.StringMapOutput {
   319  	return o.ApplyT(func(v *Workgroup) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   320  }
   321  
   322  type WorkgroupArrayOutput struct{ *pulumi.OutputState }
   323  
   324  func (WorkgroupArrayOutput) ElementType() reflect.Type {
   325  	return reflect.TypeOf((*[]*Workgroup)(nil)).Elem()
   326  }
   327  
   328  func (o WorkgroupArrayOutput) ToWorkgroupArrayOutput() WorkgroupArrayOutput {
   329  	return o
   330  }
   331  
   332  func (o WorkgroupArrayOutput) ToWorkgroupArrayOutputWithContext(ctx context.Context) WorkgroupArrayOutput {
   333  	return o
   334  }
   335  
   336  func (o WorkgroupArrayOutput) Index(i pulumi.IntInput) WorkgroupOutput {
   337  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Workgroup {
   338  		return vs[0].([]*Workgroup)[vs[1].(int)]
   339  	}).(WorkgroupOutput)
   340  }
   341  
   342  type WorkgroupMapOutput struct{ *pulumi.OutputState }
   343  
   344  func (WorkgroupMapOutput) ElementType() reflect.Type {
   345  	return reflect.TypeOf((*map[string]*Workgroup)(nil)).Elem()
   346  }
   347  
   348  func (o WorkgroupMapOutput) ToWorkgroupMapOutput() WorkgroupMapOutput {
   349  	return o
   350  }
   351  
   352  func (o WorkgroupMapOutput) ToWorkgroupMapOutputWithContext(ctx context.Context) WorkgroupMapOutput {
   353  	return o
   354  }
   355  
   356  func (o WorkgroupMapOutput) MapIndex(k pulumi.StringInput) WorkgroupOutput {
   357  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Workgroup {
   358  		return vs[0].(map[string]*Workgroup)[vs[1].(string)]
   359  	}).(WorkgroupOutput)
   360  }
   361  
   362  func init() {
   363  	pulumi.RegisterInputType(reflect.TypeOf((*WorkgroupInput)(nil)).Elem(), &Workgroup{})
   364  	pulumi.RegisterInputType(reflect.TypeOf((*WorkgroupArrayInput)(nil)).Elem(), WorkgroupArray{})
   365  	pulumi.RegisterInputType(reflect.TypeOf((*WorkgroupMapInput)(nil)).Elem(), WorkgroupMap{})
   366  	pulumi.RegisterOutputType(WorkgroupOutput{})
   367  	pulumi.RegisterOutputType(WorkgroupArrayOutput{})
   368  	pulumi.RegisterOutputType(WorkgroupMapOutput{})
   369  }