github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/emrcontainers/virtualCluster.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 emrcontainers
     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  // Manages an EMR Containers (EMR on EKS) Virtual Cluster.
    16  //
    17  // ## Example Usage
    18  //
    19  // ### Basic Usage
    20  //
    21  // <!--Start PulumiCodeChooser -->
    22  // ```go
    23  // package main
    24  //
    25  // import (
    26  //
    27  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/emrcontainers"
    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 := emrcontainers.NewVirtualCluster(ctx, "example", &emrcontainers.VirtualClusterArgs{
    35  //				ContainerProvider: &emrcontainers.VirtualClusterContainerProviderArgs{
    36  //					Id:   pulumi.Any(exampleAwsEksCluster.Name),
    37  //					Type: pulumi.String("EKS"),
    38  //					Info: &emrcontainers.VirtualClusterContainerProviderInfoArgs{
    39  //						EksInfo: &emrcontainers.VirtualClusterContainerProviderInfoEksInfoArgs{
    40  //							Namespace: pulumi.String("default"),
    41  //						},
    42  //					},
    43  //				},
    44  //				Name: pulumi.String("example"),
    45  //			})
    46  //			if err != nil {
    47  //				return err
    48  //			}
    49  //			return nil
    50  //		})
    51  //	}
    52  //
    53  // ```
    54  // <!--End PulumiCodeChooser -->
    55  //
    56  // ## Import
    57  //
    58  // Using `pulumi import`, import EKS Clusters using the `id`. For example:
    59  //
    60  // ```sh
    61  // $ pulumi import aws:emrcontainers/virtualCluster:VirtualCluster example a1b2c3d4e5f6g7h8i9j10k11l
    62  // ```
    63  type VirtualCluster struct {
    64  	pulumi.CustomResourceState
    65  
    66  	// ARN of the cluster.
    67  	Arn pulumi.StringOutput `pulumi:"arn"`
    68  	// Configuration block for the container provider associated with your cluster.
    69  	ContainerProvider VirtualClusterContainerProviderOutput `pulumi:"containerProvider"`
    70  	// Name of the virtual cluster.
    71  	Name pulumi.StringOutput `pulumi:"name"`
    72  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    73  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    74  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    75  	//
    76  	// Deprecated: Please use `tags` instead.
    77  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    78  }
    79  
    80  // NewVirtualCluster registers a new resource with the given unique name, arguments, and options.
    81  func NewVirtualCluster(ctx *pulumi.Context,
    82  	name string, args *VirtualClusterArgs, opts ...pulumi.ResourceOption) (*VirtualCluster, error) {
    83  	if args == nil {
    84  		return nil, errors.New("missing one or more required arguments")
    85  	}
    86  
    87  	if args.ContainerProvider == nil {
    88  		return nil, errors.New("invalid value for required argument 'ContainerProvider'")
    89  	}
    90  	opts = internal.PkgResourceDefaultOpts(opts)
    91  	var resource VirtualCluster
    92  	err := ctx.RegisterResource("aws:emrcontainers/virtualCluster:VirtualCluster", name, args, &resource, opts...)
    93  	if err != nil {
    94  		return nil, err
    95  	}
    96  	return &resource, nil
    97  }
    98  
    99  // GetVirtualCluster gets an existing VirtualCluster resource's state with the given name, ID, and optional
   100  // state properties that are used to uniquely qualify the lookup (nil if not required).
   101  func GetVirtualCluster(ctx *pulumi.Context,
   102  	name string, id pulumi.IDInput, state *VirtualClusterState, opts ...pulumi.ResourceOption) (*VirtualCluster, error) {
   103  	var resource VirtualCluster
   104  	err := ctx.ReadResource("aws:emrcontainers/virtualCluster:VirtualCluster", name, id, state, &resource, opts...)
   105  	if err != nil {
   106  		return nil, err
   107  	}
   108  	return &resource, nil
   109  }
   110  
   111  // Input properties used for looking up and filtering VirtualCluster resources.
   112  type virtualClusterState struct {
   113  	// ARN of the cluster.
   114  	Arn *string `pulumi:"arn"`
   115  	// Configuration block for the container provider associated with your cluster.
   116  	ContainerProvider *VirtualClusterContainerProvider `pulumi:"containerProvider"`
   117  	// Name of the virtual cluster.
   118  	Name *string `pulumi:"name"`
   119  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   120  	Tags map[string]string `pulumi:"tags"`
   121  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   122  	//
   123  	// Deprecated: Please use `tags` instead.
   124  	TagsAll map[string]string `pulumi:"tagsAll"`
   125  }
   126  
   127  type VirtualClusterState struct {
   128  	// ARN of the cluster.
   129  	Arn pulumi.StringPtrInput
   130  	// Configuration block for the container provider associated with your cluster.
   131  	ContainerProvider VirtualClusterContainerProviderPtrInput
   132  	// Name of the virtual cluster.
   133  	Name pulumi.StringPtrInput
   134  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   135  	Tags pulumi.StringMapInput
   136  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   137  	//
   138  	// Deprecated: Please use `tags` instead.
   139  	TagsAll pulumi.StringMapInput
   140  }
   141  
   142  func (VirtualClusterState) ElementType() reflect.Type {
   143  	return reflect.TypeOf((*virtualClusterState)(nil)).Elem()
   144  }
   145  
   146  type virtualClusterArgs struct {
   147  	// Configuration block for the container provider associated with your cluster.
   148  	ContainerProvider VirtualClusterContainerProvider `pulumi:"containerProvider"`
   149  	// Name of the virtual cluster.
   150  	Name *string `pulumi:"name"`
   151  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   152  	Tags map[string]string `pulumi:"tags"`
   153  }
   154  
   155  // The set of arguments for constructing a VirtualCluster resource.
   156  type VirtualClusterArgs struct {
   157  	// Configuration block for the container provider associated with your cluster.
   158  	ContainerProvider VirtualClusterContainerProviderInput
   159  	// Name of the virtual cluster.
   160  	Name pulumi.StringPtrInput
   161  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   162  	Tags pulumi.StringMapInput
   163  }
   164  
   165  func (VirtualClusterArgs) ElementType() reflect.Type {
   166  	return reflect.TypeOf((*virtualClusterArgs)(nil)).Elem()
   167  }
   168  
   169  type VirtualClusterInput interface {
   170  	pulumi.Input
   171  
   172  	ToVirtualClusterOutput() VirtualClusterOutput
   173  	ToVirtualClusterOutputWithContext(ctx context.Context) VirtualClusterOutput
   174  }
   175  
   176  func (*VirtualCluster) ElementType() reflect.Type {
   177  	return reflect.TypeOf((**VirtualCluster)(nil)).Elem()
   178  }
   179  
   180  func (i *VirtualCluster) ToVirtualClusterOutput() VirtualClusterOutput {
   181  	return i.ToVirtualClusterOutputWithContext(context.Background())
   182  }
   183  
   184  func (i *VirtualCluster) ToVirtualClusterOutputWithContext(ctx context.Context) VirtualClusterOutput {
   185  	return pulumi.ToOutputWithContext(ctx, i).(VirtualClusterOutput)
   186  }
   187  
   188  // VirtualClusterArrayInput is an input type that accepts VirtualClusterArray and VirtualClusterArrayOutput values.
   189  // You can construct a concrete instance of `VirtualClusterArrayInput` via:
   190  //
   191  //	VirtualClusterArray{ VirtualClusterArgs{...} }
   192  type VirtualClusterArrayInput interface {
   193  	pulumi.Input
   194  
   195  	ToVirtualClusterArrayOutput() VirtualClusterArrayOutput
   196  	ToVirtualClusterArrayOutputWithContext(context.Context) VirtualClusterArrayOutput
   197  }
   198  
   199  type VirtualClusterArray []VirtualClusterInput
   200  
   201  func (VirtualClusterArray) ElementType() reflect.Type {
   202  	return reflect.TypeOf((*[]*VirtualCluster)(nil)).Elem()
   203  }
   204  
   205  func (i VirtualClusterArray) ToVirtualClusterArrayOutput() VirtualClusterArrayOutput {
   206  	return i.ToVirtualClusterArrayOutputWithContext(context.Background())
   207  }
   208  
   209  func (i VirtualClusterArray) ToVirtualClusterArrayOutputWithContext(ctx context.Context) VirtualClusterArrayOutput {
   210  	return pulumi.ToOutputWithContext(ctx, i).(VirtualClusterArrayOutput)
   211  }
   212  
   213  // VirtualClusterMapInput is an input type that accepts VirtualClusterMap and VirtualClusterMapOutput values.
   214  // You can construct a concrete instance of `VirtualClusterMapInput` via:
   215  //
   216  //	VirtualClusterMap{ "key": VirtualClusterArgs{...} }
   217  type VirtualClusterMapInput interface {
   218  	pulumi.Input
   219  
   220  	ToVirtualClusterMapOutput() VirtualClusterMapOutput
   221  	ToVirtualClusterMapOutputWithContext(context.Context) VirtualClusterMapOutput
   222  }
   223  
   224  type VirtualClusterMap map[string]VirtualClusterInput
   225  
   226  func (VirtualClusterMap) ElementType() reflect.Type {
   227  	return reflect.TypeOf((*map[string]*VirtualCluster)(nil)).Elem()
   228  }
   229  
   230  func (i VirtualClusterMap) ToVirtualClusterMapOutput() VirtualClusterMapOutput {
   231  	return i.ToVirtualClusterMapOutputWithContext(context.Background())
   232  }
   233  
   234  func (i VirtualClusterMap) ToVirtualClusterMapOutputWithContext(ctx context.Context) VirtualClusterMapOutput {
   235  	return pulumi.ToOutputWithContext(ctx, i).(VirtualClusterMapOutput)
   236  }
   237  
   238  type VirtualClusterOutput struct{ *pulumi.OutputState }
   239  
   240  func (VirtualClusterOutput) ElementType() reflect.Type {
   241  	return reflect.TypeOf((**VirtualCluster)(nil)).Elem()
   242  }
   243  
   244  func (o VirtualClusterOutput) ToVirtualClusterOutput() VirtualClusterOutput {
   245  	return o
   246  }
   247  
   248  func (o VirtualClusterOutput) ToVirtualClusterOutputWithContext(ctx context.Context) VirtualClusterOutput {
   249  	return o
   250  }
   251  
   252  // ARN of the cluster.
   253  func (o VirtualClusterOutput) Arn() pulumi.StringOutput {
   254  	return o.ApplyT(func(v *VirtualCluster) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   255  }
   256  
   257  // Configuration block for the container provider associated with your cluster.
   258  func (o VirtualClusterOutput) ContainerProvider() VirtualClusterContainerProviderOutput {
   259  	return o.ApplyT(func(v *VirtualCluster) VirtualClusterContainerProviderOutput { return v.ContainerProvider }).(VirtualClusterContainerProviderOutput)
   260  }
   261  
   262  // Name of the virtual cluster.
   263  func (o VirtualClusterOutput) Name() pulumi.StringOutput {
   264  	return o.ApplyT(func(v *VirtualCluster) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   265  }
   266  
   267  // Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   268  func (o VirtualClusterOutput) Tags() pulumi.StringMapOutput {
   269  	return o.ApplyT(func(v *VirtualCluster) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   270  }
   271  
   272  // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   273  //
   274  // Deprecated: Please use `tags` instead.
   275  func (o VirtualClusterOutput) TagsAll() pulumi.StringMapOutput {
   276  	return o.ApplyT(func(v *VirtualCluster) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   277  }
   278  
   279  type VirtualClusterArrayOutput struct{ *pulumi.OutputState }
   280  
   281  func (VirtualClusterArrayOutput) ElementType() reflect.Type {
   282  	return reflect.TypeOf((*[]*VirtualCluster)(nil)).Elem()
   283  }
   284  
   285  func (o VirtualClusterArrayOutput) ToVirtualClusterArrayOutput() VirtualClusterArrayOutput {
   286  	return o
   287  }
   288  
   289  func (o VirtualClusterArrayOutput) ToVirtualClusterArrayOutputWithContext(ctx context.Context) VirtualClusterArrayOutput {
   290  	return o
   291  }
   292  
   293  func (o VirtualClusterArrayOutput) Index(i pulumi.IntInput) VirtualClusterOutput {
   294  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *VirtualCluster {
   295  		return vs[0].([]*VirtualCluster)[vs[1].(int)]
   296  	}).(VirtualClusterOutput)
   297  }
   298  
   299  type VirtualClusterMapOutput struct{ *pulumi.OutputState }
   300  
   301  func (VirtualClusterMapOutput) ElementType() reflect.Type {
   302  	return reflect.TypeOf((*map[string]*VirtualCluster)(nil)).Elem()
   303  }
   304  
   305  func (o VirtualClusterMapOutput) ToVirtualClusterMapOutput() VirtualClusterMapOutput {
   306  	return o
   307  }
   308  
   309  func (o VirtualClusterMapOutput) ToVirtualClusterMapOutputWithContext(ctx context.Context) VirtualClusterMapOutput {
   310  	return o
   311  }
   312  
   313  func (o VirtualClusterMapOutput) MapIndex(k pulumi.StringInput) VirtualClusterOutput {
   314  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *VirtualCluster {
   315  		return vs[0].(map[string]*VirtualCluster)[vs[1].(string)]
   316  	}).(VirtualClusterOutput)
   317  }
   318  
   319  func init() {
   320  	pulumi.RegisterInputType(reflect.TypeOf((*VirtualClusterInput)(nil)).Elem(), &VirtualCluster{})
   321  	pulumi.RegisterInputType(reflect.TypeOf((*VirtualClusterArrayInput)(nil)).Elem(), VirtualClusterArray{})
   322  	pulumi.RegisterInputType(reflect.TypeOf((*VirtualClusterMapInput)(nil)).Elem(), VirtualClusterMap{})
   323  	pulumi.RegisterOutputType(VirtualClusterOutput{})
   324  	pulumi.RegisterOutputType(VirtualClusterArrayOutput{})
   325  	pulumi.RegisterOutputType(VirtualClusterMapOutput{})
   326  }