github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/emrcontainers/jobTemplate.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) Job Template.
    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.NewJobTemplate(ctx, "example", &emrcontainers.JobTemplateArgs{
    35  //				JobTemplateData: &emrcontainers.JobTemplateJobTemplateDataArgs{
    36  //					ExecutionRoleArn: pulumi.Any(exampleAwsIamRole.Arn),
    37  //					ReleaseLabel:     pulumi.String("emr-6.10.0-latest"),
    38  //					JobDriver: &emrcontainers.JobTemplateJobTemplateDataJobDriverArgs{
    39  //						SparkSqlJobDriver: &emrcontainers.JobTemplateJobTemplateDataJobDriverSparkSqlJobDriverArgs{
    40  //							EntryPoint: 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 job templates using the `id`. For example:
    59  //
    60  // ```sh
    61  // $ pulumi import aws:emrcontainers/jobTemplate:JobTemplate example a1b2c3d4e5f6g7h8i9j10k11l
    62  // ```
    63  type JobTemplate struct {
    64  	pulumi.CustomResourceState
    65  
    66  	// ARN of the job template.
    67  	Arn pulumi.StringOutput `pulumi:"arn"`
    68  	// The job template data which holds values of StartJobRun API request.
    69  	JobTemplateData JobTemplateJobTemplateDataOutput `pulumi:"jobTemplateData"`
    70  	// The KMS key ARN used to encrypt the job template.
    71  	KmsKeyArn pulumi.StringPtrOutput `pulumi:"kmsKeyArn"`
    72  	// The specified name of the job template.
    73  	Name pulumi.StringOutput `pulumi:"name"`
    74  	// 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.
    75  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    76  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    77  	//
    78  	// Deprecated: Please use `tags` instead.
    79  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    80  }
    81  
    82  // NewJobTemplate registers a new resource with the given unique name, arguments, and options.
    83  func NewJobTemplate(ctx *pulumi.Context,
    84  	name string, args *JobTemplateArgs, opts ...pulumi.ResourceOption) (*JobTemplate, error) {
    85  	if args == nil {
    86  		return nil, errors.New("missing one or more required arguments")
    87  	}
    88  
    89  	if args.JobTemplateData == nil {
    90  		return nil, errors.New("invalid value for required argument 'JobTemplateData'")
    91  	}
    92  	opts = internal.PkgResourceDefaultOpts(opts)
    93  	var resource JobTemplate
    94  	err := ctx.RegisterResource("aws:emrcontainers/jobTemplate:JobTemplate", name, args, &resource, opts...)
    95  	if err != nil {
    96  		return nil, err
    97  	}
    98  	return &resource, nil
    99  }
   100  
   101  // GetJobTemplate gets an existing JobTemplate resource's state with the given name, ID, and optional
   102  // state properties that are used to uniquely qualify the lookup (nil if not required).
   103  func GetJobTemplate(ctx *pulumi.Context,
   104  	name string, id pulumi.IDInput, state *JobTemplateState, opts ...pulumi.ResourceOption) (*JobTemplate, error) {
   105  	var resource JobTemplate
   106  	err := ctx.ReadResource("aws:emrcontainers/jobTemplate:JobTemplate", name, id, state, &resource, opts...)
   107  	if err != nil {
   108  		return nil, err
   109  	}
   110  	return &resource, nil
   111  }
   112  
   113  // Input properties used for looking up and filtering JobTemplate resources.
   114  type jobTemplateState struct {
   115  	// ARN of the job template.
   116  	Arn *string `pulumi:"arn"`
   117  	// The job template data which holds values of StartJobRun API request.
   118  	JobTemplateData *JobTemplateJobTemplateData `pulumi:"jobTemplateData"`
   119  	// The KMS key ARN used to encrypt the job template.
   120  	KmsKeyArn *string `pulumi:"kmsKeyArn"`
   121  	// The specified name of the job template.
   122  	Name *string `pulumi:"name"`
   123  	// 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.
   124  	Tags map[string]string `pulumi:"tags"`
   125  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   126  	//
   127  	// Deprecated: Please use `tags` instead.
   128  	TagsAll map[string]string `pulumi:"tagsAll"`
   129  }
   130  
   131  type JobTemplateState struct {
   132  	// ARN of the job template.
   133  	Arn pulumi.StringPtrInput
   134  	// The job template data which holds values of StartJobRun API request.
   135  	JobTemplateData JobTemplateJobTemplateDataPtrInput
   136  	// The KMS key ARN used to encrypt the job template.
   137  	KmsKeyArn pulumi.StringPtrInput
   138  	// The specified name of the job template.
   139  	Name pulumi.StringPtrInput
   140  	// 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.
   141  	Tags pulumi.StringMapInput
   142  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   143  	//
   144  	// Deprecated: Please use `tags` instead.
   145  	TagsAll pulumi.StringMapInput
   146  }
   147  
   148  func (JobTemplateState) ElementType() reflect.Type {
   149  	return reflect.TypeOf((*jobTemplateState)(nil)).Elem()
   150  }
   151  
   152  type jobTemplateArgs struct {
   153  	// The job template data which holds values of StartJobRun API request.
   154  	JobTemplateData JobTemplateJobTemplateData `pulumi:"jobTemplateData"`
   155  	// The KMS key ARN used to encrypt the job template.
   156  	KmsKeyArn *string `pulumi:"kmsKeyArn"`
   157  	// The specified name of the job template.
   158  	Name *string `pulumi:"name"`
   159  	// 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.
   160  	Tags map[string]string `pulumi:"tags"`
   161  }
   162  
   163  // The set of arguments for constructing a JobTemplate resource.
   164  type JobTemplateArgs struct {
   165  	// The job template data which holds values of StartJobRun API request.
   166  	JobTemplateData JobTemplateJobTemplateDataInput
   167  	// The KMS key ARN used to encrypt the job template.
   168  	KmsKeyArn pulumi.StringPtrInput
   169  	// The specified name of the job template.
   170  	Name pulumi.StringPtrInput
   171  	// 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.
   172  	Tags pulumi.StringMapInput
   173  }
   174  
   175  func (JobTemplateArgs) ElementType() reflect.Type {
   176  	return reflect.TypeOf((*jobTemplateArgs)(nil)).Elem()
   177  }
   178  
   179  type JobTemplateInput interface {
   180  	pulumi.Input
   181  
   182  	ToJobTemplateOutput() JobTemplateOutput
   183  	ToJobTemplateOutputWithContext(ctx context.Context) JobTemplateOutput
   184  }
   185  
   186  func (*JobTemplate) ElementType() reflect.Type {
   187  	return reflect.TypeOf((**JobTemplate)(nil)).Elem()
   188  }
   189  
   190  func (i *JobTemplate) ToJobTemplateOutput() JobTemplateOutput {
   191  	return i.ToJobTemplateOutputWithContext(context.Background())
   192  }
   193  
   194  func (i *JobTemplate) ToJobTemplateOutputWithContext(ctx context.Context) JobTemplateOutput {
   195  	return pulumi.ToOutputWithContext(ctx, i).(JobTemplateOutput)
   196  }
   197  
   198  // JobTemplateArrayInput is an input type that accepts JobTemplateArray and JobTemplateArrayOutput values.
   199  // You can construct a concrete instance of `JobTemplateArrayInput` via:
   200  //
   201  //	JobTemplateArray{ JobTemplateArgs{...} }
   202  type JobTemplateArrayInput interface {
   203  	pulumi.Input
   204  
   205  	ToJobTemplateArrayOutput() JobTemplateArrayOutput
   206  	ToJobTemplateArrayOutputWithContext(context.Context) JobTemplateArrayOutput
   207  }
   208  
   209  type JobTemplateArray []JobTemplateInput
   210  
   211  func (JobTemplateArray) ElementType() reflect.Type {
   212  	return reflect.TypeOf((*[]*JobTemplate)(nil)).Elem()
   213  }
   214  
   215  func (i JobTemplateArray) ToJobTemplateArrayOutput() JobTemplateArrayOutput {
   216  	return i.ToJobTemplateArrayOutputWithContext(context.Background())
   217  }
   218  
   219  func (i JobTemplateArray) ToJobTemplateArrayOutputWithContext(ctx context.Context) JobTemplateArrayOutput {
   220  	return pulumi.ToOutputWithContext(ctx, i).(JobTemplateArrayOutput)
   221  }
   222  
   223  // JobTemplateMapInput is an input type that accepts JobTemplateMap and JobTemplateMapOutput values.
   224  // You can construct a concrete instance of `JobTemplateMapInput` via:
   225  //
   226  //	JobTemplateMap{ "key": JobTemplateArgs{...} }
   227  type JobTemplateMapInput interface {
   228  	pulumi.Input
   229  
   230  	ToJobTemplateMapOutput() JobTemplateMapOutput
   231  	ToJobTemplateMapOutputWithContext(context.Context) JobTemplateMapOutput
   232  }
   233  
   234  type JobTemplateMap map[string]JobTemplateInput
   235  
   236  func (JobTemplateMap) ElementType() reflect.Type {
   237  	return reflect.TypeOf((*map[string]*JobTemplate)(nil)).Elem()
   238  }
   239  
   240  func (i JobTemplateMap) ToJobTemplateMapOutput() JobTemplateMapOutput {
   241  	return i.ToJobTemplateMapOutputWithContext(context.Background())
   242  }
   243  
   244  func (i JobTemplateMap) ToJobTemplateMapOutputWithContext(ctx context.Context) JobTemplateMapOutput {
   245  	return pulumi.ToOutputWithContext(ctx, i).(JobTemplateMapOutput)
   246  }
   247  
   248  type JobTemplateOutput struct{ *pulumi.OutputState }
   249  
   250  func (JobTemplateOutput) ElementType() reflect.Type {
   251  	return reflect.TypeOf((**JobTemplate)(nil)).Elem()
   252  }
   253  
   254  func (o JobTemplateOutput) ToJobTemplateOutput() JobTemplateOutput {
   255  	return o
   256  }
   257  
   258  func (o JobTemplateOutput) ToJobTemplateOutputWithContext(ctx context.Context) JobTemplateOutput {
   259  	return o
   260  }
   261  
   262  // ARN of the job template.
   263  func (o JobTemplateOutput) Arn() pulumi.StringOutput {
   264  	return o.ApplyT(func(v *JobTemplate) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   265  }
   266  
   267  // The job template data which holds values of StartJobRun API request.
   268  func (o JobTemplateOutput) JobTemplateData() JobTemplateJobTemplateDataOutput {
   269  	return o.ApplyT(func(v *JobTemplate) JobTemplateJobTemplateDataOutput { return v.JobTemplateData }).(JobTemplateJobTemplateDataOutput)
   270  }
   271  
   272  // The KMS key ARN used to encrypt the job template.
   273  func (o JobTemplateOutput) KmsKeyArn() pulumi.StringPtrOutput {
   274  	return o.ApplyT(func(v *JobTemplate) pulumi.StringPtrOutput { return v.KmsKeyArn }).(pulumi.StringPtrOutput)
   275  }
   276  
   277  // The specified name of the job template.
   278  func (o JobTemplateOutput) Name() pulumi.StringOutput {
   279  	return o.ApplyT(func(v *JobTemplate) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   280  }
   281  
   282  // 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.
   283  func (o JobTemplateOutput) Tags() pulumi.StringMapOutput {
   284  	return o.ApplyT(func(v *JobTemplate) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   285  }
   286  
   287  // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   288  //
   289  // Deprecated: Please use `tags` instead.
   290  func (o JobTemplateOutput) TagsAll() pulumi.StringMapOutput {
   291  	return o.ApplyT(func(v *JobTemplate) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   292  }
   293  
   294  type JobTemplateArrayOutput struct{ *pulumi.OutputState }
   295  
   296  func (JobTemplateArrayOutput) ElementType() reflect.Type {
   297  	return reflect.TypeOf((*[]*JobTemplate)(nil)).Elem()
   298  }
   299  
   300  func (o JobTemplateArrayOutput) ToJobTemplateArrayOutput() JobTemplateArrayOutput {
   301  	return o
   302  }
   303  
   304  func (o JobTemplateArrayOutput) ToJobTemplateArrayOutputWithContext(ctx context.Context) JobTemplateArrayOutput {
   305  	return o
   306  }
   307  
   308  func (o JobTemplateArrayOutput) Index(i pulumi.IntInput) JobTemplateOutput {
   309  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *JobTemplate {
   310  		return vs[0].([]*JobTemplate)[vs[1].(int)]
   311  	}).(JobTemplateOutput)
   312  }
   313  
   314  type JobTemplateMapOutput struct{ *pulumi.OutputState }
   315  
   316  func (JobTemplateMapOutput) ElementType() reflect.Type {
   317  	return reflect.TypeOf((*map[string]*JobTemplate)(nil)).Elem()
   318  }
   319  
   320  func (o JobTemplateMapOutput) ToJobTemplateMapOutput() JobTemplateMapOutput {
   321  	return o
   322  }
   323  
   324  func (o JobTemplateMapOutput) ToJobTemplateMapOutputWithContext(ctx context.Context) JobTemplateMapOutput {
   325  	return o
   326  }
   327  
   328  func (o JobTemplateMapOutput) MapIndex(k pulumi.StringInput) JobTemplateOutput {
   329  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *JobTemplate {
   330  		return vs[0].(map[string]*JobTemplate)[vs[1].(string)]
   331  	}).(JobTemplateOutput)
   332  }
   333  
   334  func init() {
   335  	pulumi.RegisterInputType(reflect.TypeOf((*JobTemplateInput)(nil)).Elem(), &JobTemplate{})
   336  	pulumi.RegisterInputType(reflect.TypeOf((*JobTemplateArrayInput)(nil)).Elem(), JobTemplateArray{})
   337  	pulumi.RegisterInputType(reflect.TypeOf((*JobTemplateMapInput)(nil)).Elem(), JobTemplateMap{})
   338  	pulumi.RegisterOutputType(JobTemplateOutput{})
   339  	pulumi.RegisterOutputType(JobTemplateArrayOutput{})
   340  	pulumi.RegisterOutputType(JobTemplateMapOutput{})
   341  }