github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/cfg/conformancePack.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 cfg 5 6 import ( 7 "context" 8 "reflect" 9 10 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Manages a Config Conformance Pack. More information about this collection of Config rules and remediation actions can be found in the 15 // [Conformance Packs](https://docs.aws.amazon.com/config/latest/developerguide/conformance-packs.html) documentation. 16 // Sample Conformance Pack templates may be found in the 17 // [AWS Config Rules Repository](https://github.com/awslabs/aws-config-rules/tree/master/aws-config-conformance-packs). 18 // 19 // > **NOTE:** The account must have a Configuration Recorder with proper IAM permissions before the Conformance Pack will 20 // successfully create or update. See also the 21 // `cfg.Recorder` resource. 22 // 23 // ## Example Usage 24 // 25 // ### Template Body 26 // 27 // <!--Start PulumiCodeChooser --> 28 // ```go 29 // package main 30 // 31 // import ( 32 // 33 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cfg" 34 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 35 // 36 // ) 37 // 38 // func main() { 39 // pulumi.Run(func(ctx *pulumi.Context) error { 40 // _, err := cfg.NewConformancePack(ctx, "example", &cfg.ConformancePackArgs{ 41 // Name: pulumi.String("example"), 42 // InputParameters: cfg.ConformancePackInputParameterArray{ 43 // &cfg.ConformancePackInputParameterArgs{ 44 // ParameterName: pulumi.String("AccessKeysRotatedParameterMaxAccessKeyAge"), 45 // ParameterValue: pulumi.String("90"), 46 // }, 47 // }, 48 // TemplateBody: pulumi.String(`Parameters: 49 // AccessKeysRotatedParameterMaxAccessKeyAge: 50 // Type: String 51 // 52 // Resources: 53 // 54 // IAMPasswordPolicy: 55 // Properties: 56 // ConfigRuleName: IAMPasswordPolicy 57 // Source: 58 // Owner: AWS 59 // SourceIdentifier: IAM_PASSWORD_POLICY 60 // Type: AWS::Config::ConfigRule 61 // 62 // `), 63 // 64 // }, pulumi.DependsOn([]pulumi.Resource{ 65 // exampleAwsConfigConfigurationRecorder, 66 // })) 67 // if err != nil { 68 // return err 69 // } 70 // return nil 71 // }) 72 // } 73 // 74 // ``` 75 // <!--End PulumiCodeChooser --> 76 // 77 // ### Template S3 URI 78 // 79 // <!--Start PulumiCodeChooser --> 80 // ```go 81 // package main 82 // 83 // import ( 84 // 85 // "fmt" 86 // 87 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cfg" 88 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3" 89 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 90 // 91 // ) 92 // 93 // func main() { 94 // pulumi.Run(func(ctx *pulumi.Context) error { 95 // exampleBucketV2, err := s3.NewBucketV2(ctx, "example", &s3.BucketV2Args{ 96 // Bucket: pulumi.String("example"), 97 // }) 98 // if err != nil { 99 // return err 100 // } 101 // exampleBucketObjectv2, err := s3.NewBucketObjectv2(ctx, "example", &s3.BucketObjectv2Args{ 102 // Bucket: exampleBucketV2.ID(), 103 // Key: pulumi.String("example-key"), 104 // Content: pulumi.String(`Resources: 105 // IAMPasswordPolicy: 106 // Properties: 107 // ConfigRuleName: IAMPasswordPolicy 108 // Source: 109 // Owner: AWS 110 // SourceIdentifier: IAM_PASSWORD_POLICY 111 // Type: AWS::Config::ConfigRule 112 // 113 // `), 114 // 115 // }) 116 // if err != nil { 117 // return err 118 // } 119 // _, err = cfg.NewConformancePack(ctx, "example", &cfg.ConformancePackArgs{ 120 // Name: pulumi.String("example"), 121 // TemplateS3Uri: pulumi.All(exampleBucketV2.Bucket, exampleBucketObjectv2.Key).ApplyT(func(_args []interface{}) (string, error) { 122 // bucket := _args[0].(string) 123 // key := _args[1].(string) 124 // return fmt.Sprintf("s3://%v/%v", bucket, key), nil 125 // }).(pulumi.StringOutput), 126 // }, pulumi.DependsOn([]pulumi.Resource{ 127 // exampleAwsConfigConfigurationRecorder, 128 // })) 129 // if err != nil { 130 // return err 131 // } 132 // return nil 133 // }) 134 // } 135 // 136 // ``` 137 // <!--End PulumiCodeChooser --> 138 // 139 // ## Import 140 // 141 // Using `pulumi import`, import Config Conformance Packs using the `name`. For example: 142 // 143 // ```sh 144 // $ pulumi import aws:cfg/conformancePack:ConformancePack example example 145 // ``` 146 type ConformancePack struct { 147 pulumi.CustomResourceState 148 149 // Amazon Resource Name (ARN) of the conformance pack. 150 Arn pulumi.StringOutput `pulumi:"arn"` 151 // Amazon S3 bucket where AWS Config stores conformance pack templates. Maximum length of 63. 152 DeliveryS3Bucket pulumi.StringPtrOutput `pulumi:"deliveryS3Bucket"` 153 // The prefix for the Amazon S3 bucket. Maximum length of 1024. 154 DeliveryS3KeyPrefix pulumi.StringPtrOutput `pulumi:"deliveryS3KeyPrefix"` 155 // Set of configuration blocks describing input parameters passed to the conformance pack template. Documented below. When configured, the parameters must also be included in the `templateBody` or in the template stored in Amazon S3 if using `templateS3Uri`. 156 InputParameters ConformancePackInputParameterArrayOutput `pulumi:"inputParameters"` 157 // The name of the conformance pack. Must begin with a letter and contain from 1 to 256 alphanumeric characters and hyphens. 158 Name pulumi.StringOutput `pulumi:"name"` 159 // A string containing full conformance pack template body. Maximum length of 51200. Drift detection is not possible with this argument. 160 TemplateBody pulumi.StringPtrOutput `pulumi:"templateBody"` 161 // Location of file, e.g., `s3://bucketname/prefix`, containing the template body. The uri must point to the conformance pack template that is located in an Amazon S3 bucket in the same region as the conformance pack. Maximum length of 1024. Drift detection is not possible with this argument. 162 TemplateS3Uri pulumi.StringPtrOutput `pulumi:"templateS3Uri"` 163 } 164 165 // NewConformancePack registers a new resource with the given unique name, arguments, and options. 166 func NewConformancePack(ctx *pulumi.Context, 167 name string, args *ConformancePackArgs, opts ...pulumi.ResourceOption) (*ConformancePack, error) { 168 if args == nil { 169 args = &ConformancePackArgs{} 170 } 171 172 opts = internal.PkgResourceDefaultOpts(opts) 173 var resource ConformancePack 174 err := ctx.RegisterResource("aws:cfg/conformancePack:ConformancePack", name, args, &resource, opts...) 175 if err != nil { 176 return nil, err 177 } 178 return &resource, nil 179 } 180 181 // GetConformancePack gets an existing ConformancePack resource's state with the given name, ID, and optional 182 // state properties that are used to uniquely qualify the lookup (nil if not required). 183 func GetConformancePack(ctx *pulumi.Context, 184 name string, id pulumi.IDInput, state *ConformancePackState, opts ...pulumi.ResourceOption) (*ConformancePack, error) { 185 var resource ConformancePack 186 err := ctx.ReadResource("aws:cfg/conformancePack:ConformancePack", name, id, state, &resource, opts...) 187 if err != nil { 188 return nil, err 189 } 190 return &resource, nil 191 } 192 193 // Input properties used for looking up and filtering ConformancePack resources. 194 type conformancePackState struct { 195 // Amazon Resource Name (ARN) of the conformance pack. 196 Arn *string `pulumi:"arn"` 197 // Amazon S3 bucket where AWS Config stores conformance pack templates. Maximum length of 63. 198 DeliveryS3Bucket *string `pulumi:"deliveryS3Bucket"` 199 // The prefix for the Amazon S3 bucket. Maximum length of 1024. 200 DeliveryS3KeyPrefix *string `pulumi:"deliveryS3KeyPrefix"` 201 // Set of configuration blocks describing input parameters passed to the conformance pack template. Documented below. When configured, the parameters must also be included in the `templateBody` or in the template stored in Amazon S3 if using `templateS3Uri`. 202 InputParameters []ConformancePackInputParameter `pulumi:"inputParameters"` 203 // The name of the conformance pack. Must begin with a letter and contain from 1 to 256 alphanumeric characters and hyphens. 204 Name *string `pulumi:"name"` 205 // A string containing full conformance pack template body. Maximum length of 51200. Drift detection is not possible with this argument. 206 TemplateBody *string `pulumi:"templateBody"` 207 // Location of file, e.g., `s3://bucketname/prefix`, containing the template body. The uri must point to the conformance pack template that is located in an Amazon S3 bucket in the same region as the conformance pack. Maximum length of 1024. Drift detection is not possible with this argument. 208 TemplateS3Uri *string `pulumi:"templateS3Uri"` 209 } 210 211 type ConformancePackState struct { 212 // Amazon Resource Name (ARN) of the conformance pack. 213 Arn pulumi.StringPtrInput 214 // Amazon S3 bucket where AWS Config stores conformance pack templates. Maximum length of 63. 215 DeliveryS3Bucket pulumi.StringPtrInput 216 // The prefix for the Amazon S3 bucket. Maximum length of 1024. 217 DeliveryS3KeyPrefix pulumi.StringPtrInput 218 // Set of configuration blocks describing input parameters passed to the conformance pack template. Documented below. When configured, the parameters must also be included in the `templateBody` or in the template stored in Amazon S3 if using `templateS3Uri`. 219 InputParameters ConformancePackInputParameterArrayInput 220 // The name of the conformance pack. Must begin with a letter and contain from 1 to 256 alphanumeric characters and hyphens. 221 Name pulumi.StringPtrInput 222 // A string containing full conformance pack template body. Maximum length of 51200. Drift detection is not possible with this argument. 223 TemplateBody pulumi.StringPtrInput 224 // Location of file, e.g., `s3://bucketname/prefix`, containing the template body. The uri must point to the conformance pack template that is located in an Amazon S3 bucket in the same region as the conformance pack. Maximum length of 1024. Drift detection is not possible with this argument. 225 TemplateS3Uri pulumi.StringPtrInput 226 } 227 228 func (ConformancePackState) ElementType() reflect.Type { 229 return reflect.TypeOf((*conformancePackState)(nil)).Elem() 230 } 231 232 type conformancePackArgs struct { 233 // Amazon S3 bucket where AWS Config stores conformance pack templates. Maximum length of 63. 234 DeliveryS3Bucket *string `pulumi:"deliveryS3Bucket"` 235 // The prefix for the Amazon S3 bucket. Maximum length of 1024. 236 DeliveryS3KeyPrefix *string `pulumi:"deliveryS3KeyPrefix"` 237 // Set of configuration blocks describing input parameters passed to the conformance pack template. Documented below. When configured, the parameters must also be included in the `templateBody` or in the template stored in Amazon S3 if using `templateS3Uri`. 238 InputParameters []ConformancePackInputParameter `pulumi:"inputParameters"` 239 // The name of the conformance pack. Must begin with a letter and contain from 1 to 256 alphanumeric characters and hyphens. 240 Name *string `pulumi:"name"` 241 // A string containing full conformance pack template body. Maximum length of 51200. Drift detection is not possible with this argument. 242 TemplateBody *string `pulumi:"templateBody"` 243 // Location of file, e.g., `s3://bucketname/prefix`, containing the template body. The uri must point to the conformance pack template that is located in an Amazon S3 bucket in the same region as the conformance pack. Maximum length of 1024. Drift detection is not possible with this argument. 244 TemplateS3Uri *string `pulumi:"templateS3Uri"` 245 } 246 247 // The set of arguments for constructing a ConformancePack resource. 248 type ConformancePackArgs struct { 249 // Amazon S3 bucket where AWS Config stores conformance pack templates. Maximum length of 63. 250 DeliveryS3Bucket pulumi.StringPtrInput 251 // The prefix for the Amazon S3 bucket. Maximum length of 1024. 252 DeliveryS3KeyPrefix pulumi.StringPtrInput 253 // Set of configuration blocks describing input parameters passed to the conformance pack template. Documented below. When configured, the parameters must also be included in the `templateBody` or in the template stored in Amazon S3 if using `templateS3Uri`. 254 InputParameters ConformancePackInputParameterArrayInput 255 // The name of the conformance pack. Must begin with a letter and contain from 1 to 256 alphanumeric characters and hyphens. 256 Name pulumi.StringPtrInput 257 // A string containing full conformance pack template body. Maximum length of 51200. Drift detection is not possible with this argument. 258 TemplateBody pulumi.StringPtrInput 259 // Location of file, e.g., `s3://bucketname/prefix`, containing the template body. The uri must point to the conformance pack template that is located in an Amazon S3 bucket in the same region as the conformance pack. Maximum length of 1024. Drift detection is not possible with this argument. 260 TemplateS3Uri pulumi.StringPtrInput 261 } 262 263 func (ConformancePackArgs) ElementType() reflect.Type { 264 return reflect.TypeOf((*conformancePackArgs)(nil)).Elem() 265 } 266 267 type ConformancePackInput interface { 268 pulumi.Input 269 270 ToConformancePackOutput() ConformancePackOutput 271 ToConformancePackOutputWithContext(ctx context.Context) ConformancePackOutput 272 } 273 274 func (*ConformancePack) ElementType() reflect.Type { 275 return reflect.TypeOf((**ConformancePack)(nil)).Elem() 276 } 277 278 func (i *ConformancePack) ToConformancePackOutput() ConformancePackOutput { 279 return i.ToConformancePackOutputWithContext(context.Background()) 280 } 281 282 func (i *ConformancePack) ToConformancePackOutputWithContext(ctx context.Context) ConformancePackOutput { 283 return pulumi.ToOutputWithContext(ctx, i).(ConformancePackOutput) 284 } 285 286 // ConformancePackArrayInput is an input type that accepts ConformancePackArray and ConformancePackArrayOutput values. 287 // You can construct a concrete instance of `ConformancePackArrayInput` via: 288 // 289 // ConformancePackArray{ ConformancePackArgs{...} } 290 type ConformancePackArrayInput interface { 291 pulumi.Input 292 293 ToConformancePackArrayOutput() ConformancePackArrayOutput 294 ToConformancePackArrayOutputWithContext(context.Context) ConformancePackArrayOutput 295 } 296 297 type ConformancePackArray []ConformancePackInput 298 299 func (ConformancePackArray) ElementType() reflect.Type { 300 return reflect.TypeOf((*[]*ConformancePack)(nil)).Elem() 301 } 302 303 func (i ConformancePackArray) ToConformancePackArrayOutput() ConformancePackArrayOutput { 304 return i.ToConformancePackArrayOutputWithContext(context.Background()) 305 } 306 307 func (i ConformancePackArray) ToConformancePackArrayOutputWithContext(ctx context.Context) ConformancePackArrayOutput { 308 return pulumi.ToOutputWithContext(ctx, i).(ConformancePackArrayOutput) 309 } 310 311 // ConformancePackMapInput is an input type that accepts ConformancePackMap and ConformancePackMapOutput values. 312 // You can construct a concrete instance of `ConformancePackMapInput` via: 313 // 314 // ConformancePackMap{ "key": ConformancePackArgs{...} } 315 type ConformancePackMapInput interface { 316 pulumi.Input 317 318 ToConformancePackMapOutput() ConformancePackMapOutput 319 ToConformancePackMapOutputWithContext(context.Context) ConformancePackMapOutput 320 } 321 322 type ConformancePackMap map[string]ConformancePackInput 323 324 func (ConformancePackMap) ElementType() reflect.Type { 325 return reflect.TypeOf((*map[string]*ConformancePack)(nil)).Elem() 326 } 327 328 func (i ConformancePackMap) ToConformancePackMapOutput() ConformancePackMapOutput { 329 return i.ToConformancePackMapOutputWithContext(context.Background()) 330 } 331 332 func (i ConformancePackMap) ToConformancePackMapOutputWithContext(ctx context.Context) ConformancePackMapOutput { 333 return pulumi.ToOutputWithContext(ctx, i).(ConformancePackMapOutput) 334 } 335 336 type ConformancePackOutput struct{ *pulumi.OutputState } 337 338 func (ConformancePackOutput) ElementType() reflect.Type { 339 return reflect.TypeOf((**ConformancePack)(nil)).Elem() 340 } 341 342 func (o ConformancePackOutput) ToConformancePackOutput() ConformancePackOutput { 343 return o 344 } 345 346 func (o ConformancePackOutput) ToConformancePackOutputWithContext(ctx context.Context) ConformancePackOutput { 347 return o 348 } 349 350 // Amazon Resource Name (ARN) of the conformance pack. 351 func (o ConformancePackOutput) Arn() pulumi.StringOutput { 352 return o.ApplyT(func(v *ConformancePack) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 353 } 354 355 // Amazon S3 bucket where AWS Config stores conformance pack templates. Maximum length of 63. 356 func (o ConformancePackOutput) DeliveryS3Bucket() pulumi.StringPtrOutput { 357 return o.ApplyT(func(v *ConformancePack) pulumi.StringPtrOutput { return v.DeliveryS3Bucket }).(pulumi.StringPtrOutput) 358 } 359 360 // The prefix for the Amazon S3 bucket. Maximum length of 1024. 361 func (o ConformancePackOutput) DeliveryS3KeyPrefix() pulumi.StringPtrOutput { 362 return o.ApplyT(func(v *ConformancePack) pulumi.StringPtrOutput { return v.DeliveryS3KeyPrefix }).(pulumi.StringPtrOutput) 363 } 364 365 // Set of configuration blocks describing input parameters passed to the conformance pack template. Documented below. When configured, the parameters must also be included in the `templateBody` or in the template stored in Amazon S3 if using `templateS3Uri`. 366 func (o ConformancePackOutput) InputParameters() ConformancePackInputParameterArrayOutput { 367 return o.ApplyT(func(v *ConformancePack) ConformancePackInputParameterArrayOutput { return v.InputParameters }).(ConformancePackInputParameterArrayOutput) 368 } 369 370 // The name of the conformance pack. Must begin with a letter and contain from 1 to 256 alphanumeric characters and hyphens. 371 func (o ConformancePackOutput) Name() pulumi.StringOutput { 372 return o.ApplyT(func(v *ConformancePack) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 373 } 374 375 // A string containing full conformance pack template body. Maximum length of 51200. Drift detection is not possible with this argument. 376 func (o ConformancePackOutput) TemplateBody() pulumi.StringPtrOutput { 377 return o.ApplyT(func(v *ConformancePack) pulumi.StringPtrOutput { return v.TemplateBody }).(pulumi.StringPtrOutput) 378 } 379 380 // Location of file, e.g., `s3://bucketname/prefix`, containing the template body. The uri must point to the conformance pack template that is located in an Amazon S3 bucket in the same region as the conformance pack. Maximum length of 1024. Drift detection is not possible with this argument. 381 func (o ConformancePackOutput) TemplateS3Uri() pulumi.StringPtrOutput { 382 return o.ApplyT(func(v *ConformancePack) pulumi.StringPtrOutput { return v.TemplateS3Uri }).(pulumi.StringPtrOutput) 383 } 384 385 type ConformancePackArrayOutput struct{ *pulumi.OutputState } 386 387 func (ConformancePackArrayOutput) ElementType() reflect.Type { 388 return reflect.TypeOf((*[]*ConformancePack)(nil)).Elem() 389 } 390 391 func (o ConformancePackArrayOutput) ToConformancePackArrayOutput() ConformancePackArrayOutput { 392 return o 393 } 394 395 func (o ConformancePackArrayOutput) ToConformancePackArrayOutputWithContext(ctx context.Context) ConformancePackArrayOutput { 396 return o 397 } 398 399 func (o ConformancePackArrayOutput) Index(i pulumi.IntInput) ConformancePackOutput { 400 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ConformancePack { 401 return vs[0].([]*ConformancePack)[vs[1].(int)] 402 }).(ConformancePackOutput) 403 } 404 405 type ConformancePackMapOutput struct{ *pulumi.OutputState } 406 407 func (ConformancePackMapOutput) ElementType() reflect.Type { 408 return reflect.TypeOf((*map[string]*ConformancePack)(nil)).Elem() 409 } 410 411 func (o ConformancePackMapOutput) ToConformancePackMapOutput() ConformancePackMapOutput { 412 return o 413 } 414 415 func (o ConformancePackMapOutput) ToConformancePackMapOutputWithContext(ctx context.Context) ConformancePackMapOutput { 416 return o 417 } 418 419 func (o ConformancePackMapOutput) MapIndex(k pulumi.StringInput) ConformancePackOutput { 420 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ConformancePack { 421 return vs[0].(map[string]*ConformancePack)[vs[1].(string)] 422 }).(ConformancePackOutput) 423 } 424 425 func init() { 426 pulumi.RegisterInputType(reflect.TypeOf((*ConformancePackInput)(nil)).Elem(), &ConformancePack{}) 427 pulumi.RegisterInputType(reflect.TypeOf((*ConformancePackArrayInput)(nil)).Elem(), ConformancePackArray{}) 428 pulumi.RegisterInputType(reflect.TypeOf((*ConformancePackMapInput)(nil)).Elem(), ConformancePackMap{}) 429 pulumi.RegisterOutputType(ConformancePackOutput{}) 430 pulumi.RegisterOutputType(ConformancePackArrayOutput{}) 431 pulumi.RegisterOutputType(ConformancePackMapOutput{}) 432 }