github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/dataexchange/dataSet.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 DataSets. 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.NewDataSet(ctx, "example", &dataexchange.DataSetArgs{ 33 // AssetType: pulumi.String("S3_SNAPSHOT"), 34 // Description: pulumi.String("example"), 35 // Name: pulumi.String("example"), 36 // }) 37 // if err != nil { 38 // return err 39 // } 40 // return nil 41 // }) 42 // } 43 // 44 // ``` 45 // <!--End PulumiCodeChooser --> 46 // 47 // ## Import 48 // 49 // Using `pulumi import`, import DataExchange DataSets using their ARN. For example: 50 // 51 // ```sh 52 // $ pulumi import aws:dataexchange/dataSet:DataSet example arn:aws:dataexchange:us-west-2:123456789012:data-sets/4fa784c7-ccb4-4dbf-ba4f-02198320daa1 53 // ``` 54 type DataSet struct { 55 pulumi.CustomResourceState 56 57 // The Amazon Resource Name of this data set. 58 Arn pulumi.StringOutput `pulumi:"arn"` 59 // The type of asset that is added to a data set. Valid values are: `S3_SNAPSHOT`, `REDSHIFT_DATA_SHARE`, and `API_GATEWAY_API`. 60 AssetType pulumi.StringOutput `pulumi:"assetType"` 61 // A description for the data set. 62 Description pulumi.StringOutput `pulumi:"description"` 63 // The name of the data set. 64 Name pulumi.StringOutput `pulumi:"name"` 65 // 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. 66 Tags pulumi.StringMapOutput `pulumi:"tags"` 67 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 68 // 69 // Deprecated: Please use `tags` instead. 70 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 71 } 72 73 // NewDataSet registers a new resource with the given unique name, arguments, and options. 74 func NewDataSet(ctx *pulumi.Context, 75 name string, args *DataSetArgs, opts ...pulumi.ResourceOption) (*DataSet, error) { 76 if args == nil { 77 return nil, errors.New("missing one or more required arguments") 78 } 79 80 if args.AssetType == nil { 81 return nil, errors.New("invalid value for required argument 'AssetType'") 82 } 83 if args.Description == nil { 84 return nil, errors.New("invalid value for required argument 'Description'") 85 } 86 opts = internal.PkgResourceDefaultOpts(opts) 87 var resource DataSet 88 err := ctx.RegisterResource("aws:dataexchange/dataSet:DataSet", name, args, &resource, opts...) 89 if err != nil { 90 return nil, err 91 } 92 return &resource, nil 93 } 94 95 // GetDataSet gets an existing DataSet resource's state with the given name, ID, and optional 96 // state properties that are used to uniquely qualify the lookup (nil if not required). 97 func GetDataSet(ctx *pulumi.Context, 98 name string, id pulumi.IDInput, state *DataSetState, opts ...pulumi.ResourceOption) (*DataSet, error) { 99 var resource DataSet 100 err := ctx.ReadResource("aws:dataexchange/dataSet:DataSet", name, id, state, &resource, opts...) 101 if err != nil { 102 return nil, err 103 } 104 return &resource, nil 105 } 106 107 // Input properties used for looking up and filtering DataSet resources. 108 type dataSetState struct { 109 // The Amazon Resource Name of this data set. 110 Arn *string `pulumi:"arn"` 111 // The type of asset that is added to a data set. Valid values are: `S3_SNAPSHOT`, `REDSHIFT_DATA_SHARE`, and `API_GATEWAY_API`. 112 AssetType *string `pulumi:"assetType"` 113 // A description for the data set. 114 Description *string `pulumi:"description"` 115 // The name of the data set. 116 Name *string `pulumi:"name"` 117 // 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. 118 Tags map[string]string `pulumi:"tags"` 119 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 120 // 121 // Deprecated: Please use `tags` instead. 122 TagsAll map[string]string `pulumi:"tagsAll"` 123 } 124 125 type DataSetState struct { 126 // The Amazon Resource Name of this data set. 127 Arn pulumi.StringPtrInput 128 // The type of asset that is added to a data set. Valid values are: `S3_SNAPSHOT`, `REDSHIFT_DATA_SHARE`, and `API_GATEWAY_API`. 129 AssetType pulumi.StringPtrInput 130 // A description for the data set. 131 Description pulumi.StringPtrInput 132 // The name of the data set. 133 Name pulumi.StringPtrInput 134 // 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. 135 Tags pulumi.StringMapInput 136 // A 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 (DataSetState) ElementType() reflect.Type { 143 return reflect.TypeOf((*dataSetState)(nil)).Elem() 144 } 145 146 type dataSetArgs struct { 147 // The type of asset that is added to a data set. Valid values are: `S3_SNAPSHOT`, `REDSHIFT_DATA_SHARE`, and `API_GATEWAY_API`. 148 AssetType string `pulumi:"assetType"` 149 // A description for the data set. 150 Description string `pulumi:"description"` 151 // The name of the data set. 152 Name *string `pulumi:"name"` 153 // 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. 154 Tags map[string]string `pulumi:"tags"` 155 } 156 157 // The set of arguments for constructing a DataSet resource. 158 type DataSetArgs struct { 159 // The type of asset that is added to a data set. Valid values are: `S3_SNAPSHOT`, `REDSHIFT_DATA_SHARE`, and `API_GATEWAY_API`. 160 AssetType pulumi.StringInput 161 // A description for the data set. 162 Description pulumi.StringInput 163 // The name of the data set. 164 Name pulumi.StringPtrInput 165 // 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. 166 Tags pulumi.StringMapInput 167 } 168 169 func (DataSetArgs) ElementType() reflect.Type { 170 return reflect.TypeOf((*dataSetArgs)(nil)).Elem() 171 } 172 173 type DataSetInput interface { 174 pulumi.Input 175 176 ToDataSetOutput() DataSetOutput 177 ToDataSetOutputWithContext(ctx context.Context) DataSetOutput 178 } 179 180 func (*DataSet) ElementType() reflect.Type { 181 return reflect.TypeOf((**DataSet)(nil)).Elem() 182 } 183 184 func (i *DataSet) ToDataSetOutput() DataSetOutput { 185 return i.ToDataSetOutputWithContext(context.Background()) 186 } 187 188 func (i *DataSet) ToDataSetOutputWithContext(ctx context.Context) DataSetOutput { 189 return pulumi.ToOutputWithContext(ctx, i).(DataSetOutput) 190 } 191 192 // DataSetArrayInput is an input type that accepts DataSetArray and DataSetArrayOutput values. 193 // You can construct a concrete instance of `DataSetArrayInput` via: 194 // 195 // DataSetArray{ DataSetArgs{...} } 196 type DataSetArrayInput interface { 197 pulumi.Input 198 199 ToDataSetArrayOutput() DataSetArrayOutput 200 ToDataSetArrayOutputWithContext(context.Context) DataSetArrayOutput 201 } 202 203 type DataSetArray []DataSetInput 204 205 func (DataSetArray) ElementType() reflect.Type { 206 return reflect.TypeOf((*[]*DataSet)(nil)).Elem() 207 } 208 209 func (i DataSetArray) ToDataSetArrayOutput() DataSetArrayOutput { 210 return i.ToDataSetArrayOutputWithContext(context.Background()) 211 } 212 213 func (i DataSetArray) ToDataSetArrayOutputWithContext(ctx context.Context) DataSetArrayOutput { 214 return pulumi.ToOutputWithContext(ctx, i).(DataSetArrayOutput) 215 } 216 217 // DataSetMapInput is an input type that accepts DataSetMap and DataSetMapOutput values. 218 // You can construct a concrete instance of `DataSetMapInput` via: 219 // 220 // DataSetMap{ "key": DataSetArgs{...} } 221 type DataSetMapInput interface { 222 pulumi.Input 223 224 ToDataSetMapOutput() DataSetMapOutput 225 ToDataSetMapOutputWithContext(context.Context) DataSetMapOutput 226 } 227 228 type DataSetMap map[string]DataSetInput 229 230 func (DataSetMap) ElementType() reflect.Type { 231 return reflect.TypeOf((*map[string]*DataSet)(nil)).Elem() 232 } 233 234 func (i DataSetMap) ToDataSetMapOutput() DataSetMapOutput { 235 return i.ToDataSetMapOutputWithContext(context.Background()) 236 } 237 238 func (i DataSetMap) ToDataSetMapOutputWithContext(ctx context.Context) DataSetMapOutput { 239 return pulumi.ToOutputWithContext(ctx, i).(DataSetMapOutput) 240 } 241 242 type DataSetOutput struct{ *pulumi.OutputState } 243 244 func (DataSetOutput) ElementType() reflect.Type { 245 return reflect.TypeOf((**DataSet)(nil)).Elem() 246 } 247 248 func (o DataSetOutput) ToDataSetOutput() DataSetOutput { 249 return o 250 } 251 252 func (o DataSetOutput) ToDataSetOutputWithContext(ctx context.Context) DataSetOutput { 253 return o 254 } 255 256 // The Amazon Resource Name of this data set. 257 func (o DataSetOutput) Arn() pulumi.StringOutput { 258 return o.ApplyT(func(v *DataSet) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 259 } 260 261 // The type of asset that is added to a data set. Valid values are: `S3_SNAPSHOT`, `REDSHIFT_DATA_SHARE`, and `API_GATEWAY_API`. 262 func (o DataSetOutput) AssetType() pulumi.StringOutput { 263 return o.ApplyT(func(v *DataSet) pulumi.StringOutput { return v.AssetType }).(pulumi.StringOutput) 264 } 265 266 // A description for the data set. 267 func (o DataSetOutput) Description() pulumi.StringOutput { 268 return o.ApplyT(func(v *DataSet) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput) 269 } 270 271 // The name of the data set. 272 func (o DataSetOutput) Name() pulumi.StringOutput { 273 return o.ApplyT(func(v *DataSet) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 274 } 275 276 // 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. 277 func (o DataSetOutput) Tags() pulumi.StringMapOutput { 278 return o.ApplyT(func(v *DataSet) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 279 } 280 281 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 282 // 283 // Deprecated: Please use `tags` instead. 284 func (o DataSetOutput) TagsAll() pulumi.StringMapOutput { 285 return o.ApplyT(func(v *DataSet) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 286 } 287 288 type DataSetArrayOutput struct{ *pulumi.OutputState } 289 290 func (DataSetArrayOutput) ElementType() reflect.Type { 291 return reflect.TypeOf((*[]*DataSet)(nil)).Elem() 292 } 293 294 func (o DataSetArrayOutput) ToDataSetArrayOutput() DataSetArrayOutput { 295 return o 296 } 297 298 func (o DataSetArrayOutput) ToDataSetArrayOutputWithContext(ctx context.Context) DataSetArrayOutput { 299 return o 300 } 301 302 func (o DataSetArrayOutput) Index(i pulumi.IntInput) DataSetOutput { 303 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DataSet { 304 return vs[0].([]*DataSet)[vs[1].(int)] 305 }).(DataSetOutput) 306 } 307 308 type DataSetMapOutput struct{ *pulumi.OutputState } 309 310 func (DataSetMapOutput) ElementType() reflect.Type { 311 return reflect.TypeOf((*map[string]*DataSet)(nil)).Elem() 312 } 313 314 func (o DataSetMapOutput) ToDataSetMapOutput() DataSetMapOutput { 315 return o 316 } 317 318 func (o DataSetMapOutput) ToDataSetMapOutputWithContext(ctx context.Context) DataSetMapOutput { 319 return o 320 } 321 322 func (o DataSetMapOutput) MapIndex(k pulumi.StringInput) DataSetOutput { 323 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DataSet { 324 return vs[0].(map[string]*DataSet)[vs[1].(string)] 325 }).(DataSetOutput) 326 } 327 328 func init() { 329 pulumi.RegisterInputType(reflect.TypeOf((*DataSetInput)(nil)).Elem(), &DataSet{}) 330 pulumi.RegisterInputType(reflect.TypeOf((*DataSetArrayInput)(nil)).Elem(), DataSetArray{}) 331 pulumi.RegisterInputType(reflect.TypeOf((*DataSetMapInput)(nil)).Elem(), DataSetMap{}) 332 pulumi.RegisterOutputType(DataSetOutput{}) 333 pulumi.RegisterOutputType(DataSetArrayOutput{}) 334 pulumi.RegisterOutputType(DataSetMapOutput{}) 335 }