github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/glue/dataQualityRuleset.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 glue 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 Glue Data Quality Ruleset Resource. You can refer to the [Glue Developer Guide](https://docs.aws.amazon.com/glue/latest/dg/glue-data-quality.html) for a full explanation of the Glue Data Quality Ruleset functionality 16 // 17 // ## Example Usage 18 // 19 // ### Basic 20 // 21 // <!--Start PulumiCodeChooser --> 22 // ```go 23 // package main 24 // 25 // import ( 26 // 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/glue" 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 := glue.NewDataQualityRuleset(ctx, "example", &glue.DataQualityRulesetArgs{ 35 // Name: pulumi.String("example"), 36 // Ruleset: pulumi.String("Rules = [Completeness \"colA\" between 0.4 and 0.8]"), 37 // }) 38 // if err != nil { 39 // return err 40 // } 41 // return nil 42 // }) 43 // } 44 // 45 // ``` 46 // <!--End PulumiCodeChooser --> 47 // 48 // ### With description 49 // 50 // <!--Start PulumiCodeChooser --> 51 // ```go 52 // package main 53 // 54 // import ( 55 // 56 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/glue" 57 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 58 // 59 // ) 60 // 61 // func main() { 62 // pulumi.Run(func(ctx *pulumi.Context) error { 63 // _, err := glue.NewDataQualityRuleset(ctx, "example", &glue.DataQualityRulesetArgs{ 64 // Name: pulumi.String("example"), 65 // Description: pulumi.String("example"), 66 // Ruleset: pulumi.String("Rules = [Completeness \"colA\" between 0.4 and 0.8]"), 67 // }) 68 // if err != nil { 69 // return err 70 // } 71 // return nil 72 // }) 73 // } 74 // 75 // ``` 76 // <!--End PulumiCodeChooser --> 77 // 78 // ### With tags 79 // 80 // <!--Start PulumiCodeChooser --> 81 // ```go 82 // package main 83 // 84 // import ( 85 // 86 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/glue" 87 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 88 // 89 // ) 90 // 91 // func main() { 92 // pulumi.Run(func(ctx *pulumi.Context) error { 93 // _, err := glue.NewDataQualityRuleset(ctx, "example", &glue.DataQualityRulesetArgs{ 94 // Name: pulumi.String("example"), 95 // Ruleset: pulumi.String("Rules = [Completeness \"colA\" between 0.4 and 0.8]"), 96 // Tags: pulumi.StringMap{ 97 // "hello": pulumi.String("world"), 98 // }, 99 // }) 100 // if err != nil { 101 // return err 102 // } 103 // return nil 104 // }) 105 // } 106 // 107 // ``` 108 // <!--End PulumiCodeChooser --> 109 // 110 // ### With targetTable 111 // 112 // <!--Start PulumiCodeChooser --> 113 // ```go 114 // package main 115 // 116 // import ( 117 // 118 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/glue" 119 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 120 // 121 // ) 122 // 123 // func main() { 124 // pulumi.Run(func(ctx *pulumi.Context) error { 125 // _, err := glue.NewDataQualityRuleset(ctx, "example", &glue.DataQualityRulesetArgs{ 126 // Name: pulumi.String("example"), 127 // Ruleset: pulumi.String("Rules = [Completeness \"colA\" between 0.4 and 0.8]"), 128 // TargetTable: &glue.DataQualityRulesetTargetTableArgs{ 129 // DatabaseName: pulumi.Any(exampleAwsGlueCatalogDatabase.Name), 130 // TableName: pulumi.Any(exampleAwsGlueCatalogTable.Name), 131 // }, 132 // }) 133 // if err != nil { 134 // return err 135 // } 136 // return nil 137 // }) 138 // } 139 // 140 // ``` 141 // <!--End PulumiCodeChooser --> 142 // 143 // ## Import 144 // 145 // Using `pulumi import`, import Glue Data Quality Ruleset using the `name`. For example: 146 // 147 // ```sh 148 // $ pulumi import aws:glue/dataQualityRuleset:DataQualityRuleset example exampleName 149 // ``` 150 type DataQualityRuleset struct { 151 pulumi.CustomResourceState 152 153 // ARN of the Glue Data Quality Ruleset. 154 Arn pulumi.StringOutput `pulumi:"arn"` 155 // The time and date that this data quality ruleset was created. 156 CreatedOn pulumi.StringOutput `pulumi:"createdOn"` 157 // Description of the data quality ruleset. 158 Description pulumi.StringPtrOutput `pulumi:"description"` 159 // The time and date that this data quality ruleset was created. 160 LastModifiedOn pulumi.StringOutput `pulumi:"lastModifiedOn"` 161 // Name of the data quality ruleset. 162 Name pulumi.StringOutput `pulumi:"name"` 163 // When a ruleset was created from a recommendation run, this run ID is generated to link the two together. 164 RecommendationRunId pulumi.StringOutput `pulumi:"recommendationRunId"` 165 // A Data Quality Definition Language (DQDL) ruleset. For more information, see the AWS Glue developer guide. 166 Ruleset pulumi.StringOutput `pulumi:"ruleset"` 167 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 168 Tags pulumi.StringMapOutput `pulumi:"tags"` 169 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 170 // 171 // Deprecated: Please use `tags` instead. 172 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 173 // A Configuration block specifying a target table associated with the data quality ruleset. See `targetTable` below. 174 TargetTable DataQualityRulesetTargetTablePtrOutput `pulumi:"targetTable"` 175 } 176 177 // NewDataQualityRuleset registers a new resource with the given unique name, arguments, and options. 178 func NewDataQualityRuleset(ctx *pulumi.Context, 179 name string, args *DataQualityRulesetArgs, opts ...pulumi.ResourceOption) (*DataQualityRuleset, error) { 180 if args == nil { 181 return nil, errors.New("missing one or more required arguments") 182 } 183 184 if args.Ruleset == nil { 185 return nil, errors.New("invalid value for required argument 'Ruleset'") 186 } 187 opts = internal.PkgResourceDefaultOpts(opts) 188 var resource DataQualityRuleset 189 err := ctx.RegisterResource("aws:glue/dataQualityRuleset:DataQualityRuleset", name, args, &resource, opts...) 190 if err != nil { 191 return nil, err 192 } 193 return &resource, nil 194 } 195 196 // GetDataQualityRuleset gets an existing DataQualityRuleset resource's state with the given name, ID, and optional 197 // state properties that are used to uniquely qualify the lookup (nil if not required). 198 func GetDataQualityRuleset(ctx *pulumi.Context, 199 name string, id pulumi.IDInput, state *DataQualityRulesetState, opts ...pulumi.ResourceOption) (*DataQualityRuleset, error) { 200 var resource DataQualityRuleset 201 err := ctx.ReadResource("aws:glue/dataQualityRuleset:DataQualityRuleset", name, id, state, &resource, opts...) 202 if err != nil { 203 return nil, err 204 } 205 return &resource, nil 206 } 207 208 // Input properties used for looking up and filtering DataQualityRuleset resources. 209 type dataQualityRulesetState struct { 210 // ARN of the Glue Data Quality Ruleset. 211 Arn *string `pulumi:"arn"` 212 // The time and date that this data quality ruleset was created. 213 CreatedOn *string `pulumi:"createdOn"` 214 // Description of the data quality ruleset. 215 Description *string `pulumi:"description"` 216 // The time and date that this data quality ruleset was created. 217 LastModifiedOn *string `pulumi:"lastModifiedOn"` 218 // Name of the data quality ruleset. 219 Name *string `pulumi:"name"` 220 // When a ruleset was created from a recommendation run, this run ID is generated to link the two together. 221 RecommendationRunId *string `pulumi:"recommendationRunId"` 222 // A Data Quality Definition Language (DQDL) ruleset. For more information, see the AWS Glue developer guide. 223 Ruleset *string `pulumi:"ruleset"` 224 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 225 Tags map[string]string `pulumi:"tags"` 226 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 227 // 228 // Deprecated: Please use `tags` instead. 229 TagsAll map[string]string `pulumi:"tagsAll"` 230 // A Configuration block specifying a target table associated with the data quality ruleset. See `targetTable` below. 231 TargetTable *DataQualityRulesetTargetTable `pulumi:"targetTable"` 232 } 233 234 type DataQualityRulesetState struct { 235 // ARN of the Glue Data Quality Ruleset. 236 Arn pulumi.StringPtrInput 237 // The time and date that this data quality ruleset was created. 238 CreatedOn pulumi.StringPtrInput 239 // Description of the data quality ruleset. 240 Description pulumi.StringPtrInput 241 // The time and date that this data quality ruleset was created. 242 LastModifiedOn pulumi.StringPtrInput 243 // Name of the data quality ruleset. 244 Name pulumi.StringPtrInput 245 // When a ruleset was created from a recommendation run, this run ID is generated to link the two together. 246 RecommendationRunId pulumi.StringPtrInput 247 // A Data Quality Definition Language (DQDL) ruleset. For more information, see the AWS Glue developer guide. 248 Ruleset pulumi.StringPtrInput 249 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 250 Tags pulumi.StringMapInput 251 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 252 // 253 // Deprecated: Please use `tags` instead. 254 TagsAll pulumi.StringMapInput 255 // A Configuration block specifying a target table associated with the data quality ruleset. See `targetTable` below. 256 TargetTable DataQualityRulesetTargetTablePtrInput 257 } 258 259 func (DataQualityRulesetState) ElementType() reflect.Type { 260 return reflect.TypeOf((*dataQualityRulesetState)(nil)).Elem() 261 } 262 263 type dataQualityRulesetArgs struct { 264 // Description of the data quality ruleset. 265 Description *string `pulumi:"description"` 266 // Name of the data quality ruleset. 267 Name *string `pulumi:"name"` 268 // A Data Quality Definition Language (DQDL) ruleset. For more information, see the AWS Glue developer guide. 269 Ruleset string `pulumi:"ruleset"` 270 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 271 Tags map[string]string `pulumi:"tags"` 272 // A Configuration block specifying a target table associated with the data quality ruleset. See `targetTable` below. 273 TargetTable *DataQualityRulesetTargetTable `pulumi:"targetTable"` 274 } 275 276 // The set of arguments for constructing a DataQualityRuleset resource. 277 type DataQualityRulesetArgs struct { 278 // Description of the data quality ruleset. 279 Description pulumi.StringPtrInput 280 // Name of the data quality ruleset. 281 Name pulumi.StringPtrInput 282 // A Data Quality Definition Language (DQDL) ruleset. For more information, see the AWS Glue developer guide. 283 Ruleset pulumi.StringInput 284 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 285 Tags pulumi.StringMapInput 286 // A Configuration block specifying a target table associated with the data quality ruleset. See `targetTable` below. 287 TargetTable DataQualityRulesetTargetTablePtrInput 288 } 289 290 func (DataQualityRulesetArgs) ElementType() reflect.Type { 291 return reflect.TypeOf((*dataQualityRulesetArgs)(nil)).Elem() 292 } 293 294 type DataQualityRulesetInput interface { 295 pulumi.Input 296 297 ToDataQualityRulesetOutput() DataQualityRulesetOutput 298 ToDataQualityRulesetOutputWithContext(ctx context.Context) DataQualityRulesetOutput 299 } 300 301 func (*DataQualityRuleset) ElementType() reflect.Type { 302 return reflect.TypeOf((**DataQualityRuleset)(nil)).Elem() 303 } 304 305 func (i *DataQualityRuleset) ToDataQualityRulesetOutput() DataQualityRulesetOutput { 306 return i.ToDataQualityRulesetOutputWithContext(context.Background()) 307 } 308 309 func (i *DataQualityRuleset) ToDataQualityRulesetOutputWithContext(ctx context.Context) DataQualityRulesetOutput { 310 return pulumi.ToOutputWithContext(ctx, i).(DataQualityRulesetOutput) 311 } 312 313 // DataQualityRulesetArrayInput is an input type that accepts DataQualityRulesetArray and DataQualityRulesetArrayOutput values. 314 // You can construct a concrete instance of `DataQualityRulesetArrayInput` via: 315 // 316 // DataQualityRulesetArray{ DataQualityRulesetArgs{...} } 317 type DataQualityRulesetArrayInput interface { 318 pulumi.Input 319 320 ToDataQualityRulesetArrayOutput() DataQualityRulesetArrayOutput 321 ToDataQualityRulesetArrayOutputWithContext(context.Context) DataQualityRulesetArrayOutput 322 } 323 324 type DataQualityRulesetArray []DataQualityRulesetInput 325 326 func (DataQualityRulesetArray) ElementType() reflect.Type { 327 return reflect.TypeOf((*[]*DataQualityRuleset)(nil)).Elem() 328 } 329 330 func (i DataQualityRulesetArray) ToDataQualityRulesetArrayOutput() DataQualityRulesetArrayOutput { 331 return i.ToDataQualityRulesetArrayOutputWithContext(context.Background()) 332 } 333 334 func (i DataQualityRulesetArray) ToDataQualityRulesetArrayOutputWithContext(ctx context.Context) DataQualityRulesetArrayOutput { 335 return pulumi.ToOutputWithContext(ctx, i).(DataQualityRulesetArrayOutput) 336 } 337 338 // DataQualityRulesetMapInput is an input type that accepts DataQualityRulesetMap and DataQualityRulesetMapOutput values. 339 // You can construct a concrete instance of `DataQualityRulesetMapInput` via: 340 // 341 // DataQualityRulesetMap{ "key": DataQualityRulesetArgs{...} } 342 type DataQualityRulesetMapInput interface { 343 pulumi.Input 344 345 ToDataQualityRulesetMapOutput() DataQualityRulesetMapOutput 346 ToDataQualityRulesetMapOutputWithContext(context.Context) DataQualityRulesetMapOutput 347 } 348 349 type DataQualityRulesetMap map[string]DataQualityRulesetInput 350 351 func (DataQualityRulesetMap) ElementType() reflect.Type { 352 return reflect.TypeOf((*map[string]*DataQualityRuleset)(nil)).Elem() 353 } 354 355 func (i DataQualityRulesetMap) ToDataQualityRulesetMapOutput() DataQualityRulesetMapOutput { 356 return i.ToDataQualityRulesetMapOutputWithContext(context.Background()) 357 } 358 359 func (i DataQualityRulesetMap) ToDataQualityRulesetMapOutputWithContext(ctx context.Context) DataQualityRulesetMapOutput { 360 return pulumi.ToOutputWithContext(ctx, i).(DataQualityRulesetMapOutput) 361 } 362 363 type DataQualityRulesetOutput struct{ *pulumi.OutputState } 364 365 func (DataQualityRulesetOutput) ElementType() reflect.Type { 366 return reflect.TypeOf((**DataQualityRuleset)(nil)).Elem() 367 } 368 369 func (o DataQualityRulesetOutput) ToDataQualityRulesetOutput() DataQualityRulesetOutput { 370 return o 371 } 372 373 func (o DataQualityRulesetOutput) ToDataQualityRulesetOutputWithContext(ctx context.Context) DataQualityRulesetOutput { 374 return o 375 } 376 377 // ARN of the Glue Data Quality Ruleset. 378 func (o DataQualityRulesetOutput) Arn() pulumi.StringOutput { 379 return o.ApplyT(func(v *DataQualityRuleset) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 380 } 381 382 // The time and date that this data quality ruleset was created. 383 func (o DataQualityRulesetOutput) CreatedOn() pulumi.StringOutput { 384 return o.ApplyT(func(v *DataQualityRuleset) pulumi.StringOutput { return v.CreatedOn }).(pulumi.StringOutput) 385 } 386 387 // Description of the data quality ruleset. 388 func (o DataQualityRulesetOutput) Description() pulumi.StringPtrOutput { 389 return o.ApplyT(func(v *DataQualityRuleset) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput) 390 } 391 392 // The time and date that this data quality ruleset was created. 393 func (o DataQualityRulesetOutput) LastModifiedOn() pulumi.StringOutput { 394 return o.ApplyT(func(v *DataQualityRuleset) pulumi.StringOutput { return v.LastModifiedOn }).(pulumi.StringOutput) 395 } 396 397 // Name of the data quality ruleset. 398 func (o DataQualityRulesetOutput) Name() pulumi.StringOutput { 399 return o.ApplyT(func(v *DataQualityRuleset) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 400 } 401 402 // When a ruleset was created from a recommendation run, this run ID is generated to link the two together. 403 func (o DataQualityRulesetOutput) RecommendationRunId() pulumi.StringOutput { 404 return o.ApplyT(func(v *DataQualityRuleset) pulumi.StringOutput { return v.RecommendationRunId }).(pulumi.StringOutput) 405 } 406 407 // A Data Quality Definition Language (DQDL) ruleset. For more information, see the AWS Glue developer guide. 408 func (o DataQualityRulesetOutput) Ruleset() pulumi.StringOutput { 409 return o.ApplyT(func(v *DataQualityRuleset) pulumi.StringOutput { return v.Ruleset }).(pulumi.StringOutput) 410 } 411 412 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 413 func (o DataQualityRulesetOutput) Tags() pulumi.StringMapOutput { 414 return o.ApplyT(func(v *DataQualityRuleset) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 415 } 416 417 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 418 // 419 // Deprecated: Please use `tags` instead. 420 func (o DataQualityRulesetOutput) TagsAll() pulumi.StringMapOutput { 421 return o.ApplyT(func(v *DataQualityRuleset) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 422 } 423 424 // A Configuration block specifying a target table associated with the data quality ruleset. See `targetTable` below. 425 func (o DataQualityRulesetOutput) TargetTable() DataQualityRulesetTargetTablePtrOutput { 426 return o.ApplyT(func(v *DataQualityRuleset) DataQualityRulesetTargetTablePtrOutput { return v.TargetTable }).(DataQualityRulesetTargetTablePtrOutput) 427 } 428 429 type DataQualityRulesetArrayOutput struct{ *pulumi.OutputState } 430 431 func (DataQualityRulesetArrayOutput) ElementType() reflect.Type { 432 return reflect.TypeOf((*[]*DataQualityRuleset)(nil)).Elem() 433 } 434 435 func (o DataQualityRulesetArrayOutput) ToDataQualityRulesetArrayOutput() DataQualityRulesetArrayOutput { 436 return o 437 } 438 439 func (o DataQualityRulesetArrayOutput) ToDataQualityRulesetArrayOutputWithContext(ctx context.Context) DataQualityRulesetArrayOutput { 440 return o 441 } 442 443 func (o DataQualityRulesetArrayOutput) Index(i pulumi.IntInput) DataQualityRulesetOutput { 444 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DataQualityRuleset { 445 return vs[0].([]*DataQualityRuleset)[vs[1].(int)] 446 }).(DataQualityRulesetOutput) 447 } 448 449 type DataQualityRulesetMapOutput struct{ *pulumi.OutputState } 450 451 func (DataQualityRulesetMapOutput) ElementType() reflect.Type { 452 return reflect.TypeOf((*map[string]*DataQualityRuleset)(nil)).Elem() 453 } 454 455 func (o DataQualityRulesetMapOutput) ToDataQualityRulesetMapOutput() DataQualityRulesetMapOutput { 456 return o 457 } 458 459 func (o DataQualityRulesetMapOutput) ToDataQualityRulesetMapOutputWithContext(ctx context.Context) DataQualityRulesetMapOutput { 460 return o 461 } 462 463 func (o DataQualityRulesetMapOutput) MapIndex(k pulumi.StringInput) DataQualityRulesetOutput { 464 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DataQualityRuleset { 465 return vs[0].(map[string]*DataQualityRuleset)[vs[1].(string)] 466 }).(DataQualityRulesetOutput) 467 } 468 469 func init() { 470 pulumi.RegisterInputType(reflect.TypeOf((*DataQualityRulesetInput)(nil)).Elem(), &DataQualityRuleset{}) 471 pulumi.RegisterInputType(reflect.TypeOf((*DataQualityRulesetArrayInput)(nil)).Elem(), DataQualityRulesetArray{}) 472 pulumi.RegisterInputType(reflect.TypeOf((*DataQualityRulesetMapInput)(nil)).Elem(), DataQualityRulesetMap{}) 473 pulumi.RegisterOutputType(DataQualityRulesetOutput{}) 474 pulumi.RegisterOutputType(DataQualityRulesetArrayOutput{}) 475 pulumi.RegisterOutputType(DataQualityRulesetMapOutput{}) 476 }