github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/dataexchange/revision.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 dataexchange
     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  // Provides a resource to manage AWS Data Exchange Revisions.
    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/dataexchange"
    26  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    27  //
    28  // )
    29  //
    30  //	func main() {
    31  //		pulumi.Run(func(ctx *pulumi.Context) error {
    32  //			_, err := dataexchange.NewRevision(ctx, "example", &dataexchange.RevisionArgs{
    33  //				DataSetId: pulumi.Any(exampleAwsDataexchangeDataSet.Id),
    34  //			})
    35  //			if err != nil {
    36  //				return err
    37  //			}
    38  //			return nil
    39  //		})
    40  //	}
    41  //
    42  // ```
    43  // <!--End PulumiCodeChooser -->
    44  //
    45  // ## Import
    46  //
    47  // Using `pulumi import`, import DataExchange Revisions using their `data-set-id:revision-id`. For example:
    48  //
    49  // ```sh
    50  // $ pulumi import aws:dataexchange/revision:Revision example 4fa784c7-ccb4-4dbf-ba4f-02198320daa1:4fa784c7-ccb4-4dbf-ba4f-02198320daa1
    51  // ```
    52  type Revision struct {
    53  	pulumi.CustomResourceState
    54  
    55  	// The Amazon Resource Name of this data set.
    56  	Arn pulumi.StringOutput `pulumi:"arn"`
    57  	// An optional comment about the revision.
    58  	Comment pulumi.StringPtrOutput `pulumi:"comment"`
    59  	// The dataset id.
    60  	DataSetId pulumi.StringOutput `pulumi:"dataSetId"`
    61  	// The Id of the revision.
    62  	RevisionId pulumi.StringOutput `pulumi:"revisionId"`
    63  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    64  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    65  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    66  	//
    67  	// Deprecated: Please use `tags` instead.
    68  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    69  }
    70  
    71  // NewRevision registers a new resource with the given unique name, arguments, and options.
    72  func NewRevision(ctx *pulumi.Context,
    73  	name string, args *RevisionArgs, opts ...pulumi.ResourceOption) (*Revision, error) {
    74  	if args == nil {
    75  		return nil, errors.New("missing one or more required arguments")
    76  	}
    77  
    78  	if args.DataSetId == nil {
    79  		return nil, errors.New("invalid value for required argument 'DataSetId'")
    80  	}
    81  	opts = internal.PkgResourceDefaultOpts(opts)
    82  	var resource Revision
    83  	err := ctx.RegisterResource("aws:dataexchange/revision:Revision", name, args, &resource, opts...)
    84  	if err != nil {
    85  		return nil, err
    86  	}
    87  	return &resource, nil
    88  }
    89  
    90  // GetRevision gets an existing Revision resource's state with the given name, ID, and optional
    91  // state properties that are used to uniquely qualify the lookup (nil if not required).
    92  func GetRevision(ctx *pulumi.Context,
    93  	name string, id pulumi.IDInput, state *RevisionState, opts ...pulumi.ResourceOption) (*Revision, error) {
    94  	var resource Revision
    95  	err := ctx.ReadResource("aws:dataexchange/revision:Revision", name, id, state, &resource, opts...)
    96  	if err != nil {
    97  		return nil, err
    98  	}
    99  	return &resource, nil
   100  }
   101  
   102  // Input properties used for looking up and filtering Revision resources.
   103  type revisionState struct {
   104  	// The Amazon Resource Name of this data set.
   105  	Arn *string `pulumi:"arn"`
   106  	// An optional comment about the revision.
   107  	Comment *string `pulumi:"comment"`
   108  	// The dataset id.
   109  	DataSetId *string `pulumi:"dataSetId"`
   110  	// The Id of the revision.
   111  	RevisionId *string `pulumi:"revisionId"`
   112  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   113  	Tags map[string]string `pulumi:"tags"`
   114  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   115  	//
   116  	// Deprecated: Please use `tags` instead.
   117  	TagsAll map[string]string `pulumi:"tagsAll"`
   118  }
   119  
   120  type RevisionState struct {
   121  	// The Amazon Resource Name of this data set.
   122  	Arn pulumi.StringPtrInput
   123  	// An optional comment about the revision.
   124  	Comment pulumi.StringPtrInput
   125  	// The dataset id.
   126  	DataSetId pulumi.StringPtrInput
   127  	// The Id of the revision.
   128  	RevisionId pulumi.StringPtrInput
   129  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   130  	Tags pulumi.StringMapInput
   131  	// A 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 pulumi.StringMapInput
   135  }
   136  
   137  func (RevisionState) ElementType() reflect.Type {
   138  	return reflect.TypeOf((*revisionState)(nil)).Elem()
   139  }
   140  
   141  type revisionArgs struct {
   142  	// An optional comment about the revision.
   143  	Comment *string `pulumi:"comment"`
   144  	// The dataset id.
   145  	DataSetId string `pulumi:"dataSetId"`
   146  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   147  	Tags map[string]string `pulumi:"tags"`
   148  }
   149  
   150  // The set of arguments for constructing a Revision resource.
   151  type RevisionArgs struct {
   152  	// An optional comment about the revision.
   153  	Comment pulumi.StringPtrInput
   154  	// The dataset id.
   155  	DataSetId pulumi.StringInput
   156  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   157  	Tags pulumi.StringMapInput
   158  }
   159  
   160  func (RevisionArgs) ElementType() reflect.Type {
   161  	return reflect.TypeOf((*revisionArgs)(nil)).Elem()
   162  }
   163  
   164  type RevisionInput interface {
   165  	pulumi.Input
   166  
   167  	ToRevisionOutput() RevisionOutput
   168  	ToRevisionOutputWithContext(ctx context.Context) RevisionOutput
   169  }
   170  
   171  func (*Revision) ElementType() reflect.Type {
   172  	return reflect.TypeOf((**Revision)(nil)).Elem()
   173  }
   174  
   175  func (i *Revision) ToRevisionOutput() RevisionOutput {
   176  	return i.ToRevisionOutputWithContext(context.Background())
   177  }
   178  
   179  func (i *Revision) ToRevisionOutputWithContext(ctx context.Context) RevisionOutput {
   180  	return pulumi.ToOutputWithContext(ctx, i).(RevisionOutput)
   181  }
   182  
   183  // RevisionArrayInput is an input type that accepts RevisionArray and RevisionArrayOutput values.
   184  // You can construct a concrete instance of `RevisionArrayInput` via:
   185  //
   186  //	RevisionArray{ RevisionArgs{...} }
   187  type RevisionArrayInput interface {
   188  	pulumi.Input
   189  
   190  	ToRevisionArrayOutput() RevisionArrayOutput
   191  	ToRevisionArrayOutputWithContext(context.Context) RevisionArrayOutput
   192  }
   193  
   194  type RevisionArray []RevisionInput
   195  
   196  func (RevisionArray) ElementType() reflect.Type {
   197  	return reflect.TypeOf((*[]*Revision)(nil)).Elem()
   198  }
   199  
   200  func (i RevisionArray) ToRevisionArrayOutput() RevisionArrayOutput {
   201  	return i.ToRevisionArrayOutputWithContext(context.Background())
   202  }
   203  
   204  func (i RevisionArray) ToRevisionArrayOutputWithContext(ctx context.Context) RevisionArrayOutput {
   205  	return pulumi.ToOutputWithContext(ctx, i).(RevisionArrayOutput)
   206  }
   207  
   208  // RevisionMapInput is an input type that accepts RevisionMap and RevisionMapOutput values.
   209  // You can construct a concrete instance of `RevisionMapInput` via:
   210  //
   211  //	RevisionMap{ "key": RevisionArgs{...} }
   212  type RevisionMapInput interface {
   213  	pulumi.Input
   214  
   215  	ToRevisionMapOutput() RevisionMapOutput
   216  	ToRevisionMapOutputWithContext(context.Context) RevisionMapOutput
   217  }
   218  
   219  type RevisionMap map[string]RevisionInput
   220  
   221  func (RevisionMap) ElementType() reflect.Type {
   222  	return reflect.TypeOf((*map[string]*Revision)(nil)).Elem()
   223  }
   224  
   225  func (i RevisionMap) ToRevisionMapOutput() RevisionMapOutput {
   226  	return i.ToRevisionMapOutputWithContext(context.Background())
   227  }
   228  
   229  func (i RevisionMap) ToRevisionMapOutputWithContext(ctx context.Context) RevisionMapOutput {
   230  	return pulumi.ToOutputWithContext(ctx, i).(RevisionMapOutput)
   231  }
   232  
   233  type RevisionOutput struct{ *pulumi.OutputState }
   234  
   235  func (RevisionOutput) ElementType() reflect.Type {
   236  	return reflect.TypeOf((**Revision)(nil)).Elem()
   237  }
   238  
   239  func (o RevisionOutput) ToRevisionOutput() RevisionOutput {
   240  	return o
   241  }
   242  
   243  func (o RevisionOutput) ToRevisionOutputWithContext(ctx context.Context) RevisionOutput {
   244  	return o
   245  }
   246  
   247  // The Amazon Resource Name of this data set.
   248  func (o RevisionOutput) Arn() pulumi.StringOutput {
   249  	return o.ApplyT(func(v *Revision) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   250  }
   251  
   252  // An optional comment about the revision.
   253  func (o RevisionOutput) Comment() pulumi.StringPtrOutput {
   254  	return o.ApplyT(func(v *Revision) pulumi.StringPtrOutput { return v.Comment }).(pulumi.StringPtrOutput)
   255  }
   256  
   257  // The dataset id.
   258  func (o RevisionOutput) DataSetId() pulumi.StringOutput {
   259  	return o.ApplyT(func(v *Revision) pulumi.StringOutput { return v.DataSetId }).(pulumi.StringOutput)
   260  }
   261  
   262  // The Id of the revision.
   263  func (o RevisionOutput) RevisionId() pulumi.StringOutput {
   264  	return o.ApplyT(func(v *Revision) pulumi.StringOutput { return v.RevisionId }).(pulumi.StringOutput)
   265  }
   266  
   267  // A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   268  func (o RevisionOutput) Tags() pulumi.StringMapOutput {
   269  	return o.ApplyT(func(v *Revision) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   270  }
   271  
   272  // A 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 RevisionOutput) TagsAll() pulumi.StringMapOutput {
   276  	return o.ApplyT(func(v *Revision) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   277  }
   278  
   279  type RevisionArrayOutput struct{ *pulumi.OutputState }
   280  
   281  func (RevisionArrayOutput) ElementType() reflect.Type {
   282  	return reflect.TypeOf((*[]*Revision)(nil)).Elem()
   283  }
   284  
   285  func (o RevisionArrayOutput) ToRevisionArrayOutput() RevisionArrayOutput {
   286  	return o
   287  }
   288  
   289  func (o RevisionArrayOutput) ToRevisionArrayOutputWithContext(ctx context.Context) RevisionArrayOutput {
   290  	return o
   291  }
   292  
   293  func (o RevisionArrayOutput) Index(i pulumi.IntInput) RevisionOutput {
   294  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Revision {
   295  		return vs[0].([]*Revision)[vs[1].(int)]
   296  	}).(RevisionOutput)
   297  }
   298  
   299  type RevisionMapOutput struct{ *pulumi.OutputState }
   300  
   301  func (RevisionMapOutput) ElementType() reflect.Type {
   302  	return reflect.TypeOf((*map[string]*Revision)(nil)).Elem()
   303  }
   304  
   305  func (o RevisionMapOutput) ToRevisionMapOutput() RevisionMapOutput {
   306  	return o
   307  }
   308  
   309  func (o RevisionMapOutput) ToRevisionMapOutputWithContext(ctx context.Context) RevisionMapOutput {
   310  	return o
   311  }
   312  
   313  func (o RevisionMapOutput) MapIndex(k pulumi.StringInput) RevisionOutput {
   314  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Revision {
   315  		return vs[0].(map[string]*Revision)[vs[1].(string)]
   316  	}).(RevisionOutput)
   317  }
   318  
   319  func init() {
   320  	pulumi.RegisterInputType(reflect.TypeOf((*RevisionInput)(nil)).Elem(), &Revision{})
   321  	pulumi.RegisterInputType(reflect.TypeOf((*RevisionArrayInput)(nil)).Elem(), RevisionArray{})
   322  	pulumi.RegisterInputType(reflect.TypeOf((*RevisionMapInput)(nil)).Elem(), RevisionMap{})
   323  	pulumi.RegisterOutputType(RevisionOutput{})
   324  	pulumi.RegisterOutputType(RevisionArrayOutput{})
   325  	pulumi.RegisterOutputType(RevisionMapOutput{})
   326  }