github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/backup/framework.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 backup 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 an AWS Backup Framework resource. 16 // 17 // > **Note:** For the Deployment Status of the Framework to be successful, please turn on resource tracking to enable AWS Config recording to track configuration changes of your backup resources. This can be done from the AWS Console. 18 // 19 // ## Example Usage 20 // 21 // <!--Start PulumiCodeChooser --> 22 // ```go 23 // package main 24 // 25 // import ( 26 // 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/backup" 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 := backup.NewFramework(ctx, "Example", &backup.FrameworkArgs{ 35 // Name: pulumi.String("exampleFramework"), 36 // Description: pulumi.String("this is an example framework"), 37 // Controls: backup.FrameworkControlArray{ 38 // &backup.FrameworkControlArgs{ 39 // Name: pulumi.String("BACKUP_RECOVERY_POINT_MINIMUM_RETENTION_CHECK"), 40 // InputParameters: backup.FrameworkControlInputParameterArray{ 41 // &backup.FrameworkControlInputParameterArgs{ 42 // Name: pulumi.String("requiredRetentionDays"), 43 // Value: pulumi.String("35"), 44 // }, 45 // }, 46 // }, 47 // &backup.FrameworkControlArgs{ 48 // Name: pulumi.String("BACKUP_PLAN_MIN_FREQUENCY_AND_MIN_RETENTION_CHECK"), 49 // InputParameters: backup.FrameworkControlInputParameterArray{ 50 // &backup.FrameworkControlInputParameterArgs{ 51 // Name: pulumi.String("requiredFrequencyUnit"), 52 // Value: pulumi.String("hours"), 53 // }, 54 // &backup.FrameworkControlInputParameterArgs{ 55 // Name: pulumi.String("requiredRetentionDays"), 56 // Value: pulumi.String("35"), 57 // }, 58 // &backup.FrameworkControlInputParameterArgs{ 59 // Name: pulumi.String("requiredFrequencyValue"), 60 // Value: pulumi.String("1"), 61 // }, 62 // }, 63 // }, 64 // &backup.FrameworkControlArgs{ 65 // Name: pulumi.String("BACKUP_RECOVERY_POINT_ENCRYPTED"), 66 // }, 67 // &backup.FrameworkControlArgs{ 68 // Name: pulumi.String("BACKUP_RESOURCES_PROTECTED_BY_BACKUP_PLAN"), 69 // Scope: &backup.FrameworkControlScopeArgs{ 70 // ComplianceResourceTypes: pulumi.StringArray{ 71 // pulumi.String("EBS"), 72 // }, 73 // }, 74 // }, 75 // &backup.FrameworkControlArgs{ 76 // Name: pulumi.String("BACKUP_RECOVERY_POINT_MANUAL_DELETION_DISABLED"), 77 // }, 78 // &backup.FrameworkControlArgs{ 79 // Name: pulumi.String("BACKUP_RESOURCES_PROTECTED_BY_BACKUP_VAULT_LOCK"), 80 // InputParameters: backup.FrameworkControlInputParameterArray{ 81 // &backup.FrameworkControlInputParameterArgs{ 82 // Name: pulumi.String("maxRetentionDays"), 83 // Value: pulumi.String("100"), 84 // }, 85 // &backup.FrameworkControlInputParameterArgs{ 86 // Name: pulumi.String("minRetentionDays"), 87 // Value: pulumi.String("1"), 88 // }, 89 // }, 90 // Scope: &backup.FrameworkControlScopeArgs{ 91 // ComplianceResourceTypes: pulumi.StringArray{ 92 // pulumi.String("EBS"), 93 // }, 94 // }, 95 // }, 96 // &backup.FrameworkControlArgs{ 97 // Name: pulumi.String("BACKUP_LAST_RECOVERY_POINT_CREATED"), 98 // InputParameters: backup.FrameworkControlInputParameterArray{ 99 // &backup.FrameworkControlInputParameterArgs{ 100 // Name: pulumi.String("recoveryPointAgeUnit"), 101 // Value: pulumi.String("days"), 102 // }, 103 // &backup.FrameworkControlInputParameterArgs{ 104 // Name: pulumi.String("recoveryPointAgeValue"), 105 // Value: pulumi.String("1"), 106 // }, 107 // }, 108 // Scope: &backup.FrameworkControlScopeArgs{ 109 // ComplianceResourceTypes: pulumi.StringArray{ 110 // pulumi.String("EBS"), 111 // }, 112 // }, 113 // }, 114 // }, 115 // Tags: pulumi.StringMap{ 116 // "Name": pulumi.String("Example Framework"), 117 // }, 118 // }) 119 // if err != nil { 120 // return err 121 // } 122 // return nil 123 // }) 124 // } 125 // 126 // ``` 127 // <!--End PulumiCodeChooser --> 128 // 129 // ## Import 130 // 131 // Using `pulumi import`, import Backup Framework using the `id` which corresponds to the name of the Backup Framework. For example: 132 // 133 // ```sh 134 // $ pulumi import aws:backup/framework:Framework test <id> 135 // ``` 136 type Framework struct { 137 pulumi.CustomResourceState 138 139 // The ARN of the backup framework. 140 Arn pulumi.StringOutput `pulumi:"arn"` 141 // One or more control blocks that make up the framework. Each control in the list has a name, input parameters, and scope. Detailed below. 142 Controls FrameworkControlArrayOutput `pulumi:"controls"` 143 // The date and time that a framework is created, in Unix format and Coordinated Universal Time (UTC). 144 CreationTime pulumi.StringOutput `pulumi:"creationTime"` 145 // The deployment status of a framework. The statuses are: `CREATE_IN_PROGRESS` | `UPDATE_IN_PROGRESS` | `DELETE_IN_PROGRESS` | `COMPLETED` | `FAILED`. 146 DeploymentStatus pulumi.StringOutput `pulumi:"deploymentStatus"` 147 // The description of the framework with a maximum of 1,024 characters 148 Description pulumi.StringPtrOutput `pulumi:"description"` 149 // The unique name of the framework. The name must be between 1 and 256 characters, starting with a letter, and consisting of letters, numbers, and underscores. 150 Name pulumi.StringOutput `pulumi:"name"` 151 // A framework consists of one or more controls. Each control governs a resource, such as backup plans, backup selections, backup vaults, or recovery points. You can also turn AWS Config recording on or off for each resource. For more information refer to the [AWS documentation for Framework Status](https://docs.aws.amazon.com/aws-backup/latest/devguide/API_DescribeFramework.html#Backup-DescribeFramework-response-FrameworkStatus) 152 Status pulumi.StringOutput `pulumi:"status"` 153 // Metadata that you can assign to help organize the frameworks you create. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 154 Tags pulumi.StringMapOutput `pulumi:"tags"` 155 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 156 // 157 // Deprecated: Please use `tags` instead. 158 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 159 } 160 161 // NewFramework registers a new resource with the given unique name, arguments, and options. 162 func NewFramework(ctx *pulumi.Context, 163 name string, args *FrameworkArgs, opts ...pulumi.ResourceOption) (*Framework, error) { 164 if args == nil { 165 return nil, errors.New("missing one or more required arguments") 166 } 167 168 if args.Controls == nil { 169 return nil, errors.New("invalid value for required argument 'Controls'") 170 } 171 opts = internal.PkgResourceDefaultOpts(opts) 172 var resource Framework 173 err := ctx.RegisterResource("aws:backup/framework:Framework", name, args, &resource, opts...) 174 if err != nil { 175 return nil, err 176 } 177 return &resource, nil 178 } 179 180 // GetFramework gets an existing Framework resource's state with the given name, ID, and optional 181 // state properties that are used to uniquely qualify the lookup (nil if not required). 182 func GetFramework(ctx *pulumi.Context, 183 name string, id pulumi.IDInput, state *FrameworkState, opts ...pulumi.ResourceOption) (*Framework, error) { 184 var resource Framework 185 err := ctx.ReadResource("aws:backup/framework:Framework", name, id, state, &resource, opts...) 186 if err != nil { 187 return nil, err 188 } 189 return &resource, nil 190 } 191 192 // Input properties used for looking up and filtering Framework resources. 193 type frameworkState struct { 194 // The ARN of the backup framework. 195 Arn *string `pulumi:"arn"` 196 // One or more control blocks that make up the framework. Each control in the list has a name, input parameters, and scope. Detailed below. 197 Controls []FrameworkControl `pulumi:"controls"` 198 // The date and time that a framework is created, in Unix format and Coordinated Universal Time (UTC). 199 CreationTime *string `pulumi:"creationTime"` 200 // The deployment status of a framework. The statuses are: `CREATE_IN_PROGRESS` | `UPDATE_IN_PROGRESS` | `DELETE_IN_PROGRESS` | `COMPLETED` | `FAILED`. 201 DeploymentStatus *string `pulumi:"deploymentStatus"` 202 // The description of the framework with a maximum of 1,024 characters 203 Description *string `pulumi:"description"` 204 // The unique name of the framework. The name must be between 1 and 256 characters, starting with a letter, and consisting of letters, numbers, and underscores. 205 Name *string `pulumi:"name"` 206 // A framework consists of one or more controls. Each control governs a resource, such as backup plans, backup selections, backup vaults, or recovery points. You can also turn AWS Config recording on or off for each resource. For more information refer to the [AWS documentation for Framework Status](https://docs.aws.amazon.com/aws-backup/latest/devguide/API_DescribeFramework.html#Backup-DescribeFramework-response-FrameworkStatus) 207 Status *string `pulumi:"status"` 208 // Metadata that you can assign to help organize the frameworks you create. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 209 Tags map[string]string `pulumi:"tags"` 210 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 211 // 212 // Deprecated: Please use `tags` instead. 213 TagsAll map[string]string `pulumi:"tagsAll"` 214 } 215 216 type FrameworkState struct { 217 // The ARN of the backup framework. 218 Arn pulumi.StringPtrInput 219 // One or more control blocks that make up the framework. Each control in the list has a name, input parameters, and scope. Detailed below. 220 Controls FrameworkControlArrayInput 221 // The date and time that a framework is created, in Unix format and Coordinated Universal Time (UTC). 222 CreationTime pulumi.StringPtrInput 223 // The deployment status of a framework. The statuses are: `CREATE_IN_PROGRESS` | `UPDATE_IN_PROGRESS` | `DELETE_IN_PROGRESS` | `COMPLETED` | `FAILED`. 224 DeploymentStatus pulumi.StringPtrInput 225 // The description of the framework with a maximum of 1,024 characters 226 Description pulumi.StringPtrInput 227 // The unique name of the framework. The name must be between 1 and 256 characters, starting with a letter, and consisting of letters, numbers, and underscores. 228 Name pulumi.StringPtrInput 229 // A framework consists of one or more controls. Each control governs a resource, such as backup plans, backup selections, backup vaults, or recovery points. You can also turn AWS Config recording on or off for each resource. For more information refer to the [AWS documentation for Framework Status](https://docs.aws.amazon.com/aws-backup/latest/devguide/API_DescribeFramework.html#Backup-DescribeFramework-response-FrameworkStatus) 230 Status pulumi.StringPtrInput 231 // Metadata that you can assign to help organize the frameworks you create. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 232 Tags pulumi.StringMapInput 233 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 234 // 235 // Deprecated: Please use `tags` instead. 236 TagsAll pulumi.StringMapInput 237 } 238 239 func (FrameworkState) ElementType() reflect.Type { 240 return reflect.TypeOf((*frameworkState)(nil)).Elem() 241 } 242 243 type frameworkArgs struct { 244 // One or more control blocks that make up the framework. Each control in the list has a name, input parameters, and scope. Detailed below. 245 Controls []FrameworkControl `pulumi:"controls"` 246 // The description of the framework with a maximum of 1,024 characters 247 Description *string `pulumi:"description"` 248 // The unique name of the framework. The name must be between 1 and 256 characters, starting with a letter, and consisting of letters, numbers, and underscores. 249 Name *string `pulumi:"name"` 250 // Metadata that you can assign to help organize the frameworks you create. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 251 Tags map[string]string `pulumi:"tags"` 252 } 253 254 // The set of arguments for constructing a Framework resource. 255 type FrameworkArgs struct { 256 // One or more control blocks that make up the framework. Each control in the list has a name, input parameters, and scope. Detailed below. 257 Controls FrameworkControlArrayInput 258 // The description of the framework with a maximum of 1,024 characters 259 Description pulumi.StringPtrInput 260 // The unique name of the framework. The name must be between 1 and 256 characters, starting with a letter, and consisting of letters, numbers, and underscores. 261 Name pulumi.StringPtrInput 262 // Metadata that you can assign to help organize the frameworks you create. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 263 Tags pulumi.StringMapInput 264 } 265 266 func (FrameworkArgs) ElementType() reflect.Type { 267 return reflect.TypeOf((*frameworkArgs)(nil)).Elem() 268 } 269 270 type FrameworkInput interface { 271 pulumi.Input 272 273 ToFrameworkOutput() FrameworkOutput 274 ToFrameworkOutputWithContext(ctx context.Context) FrameworkOutput 275 } 276 277 func (*Framework) ElementType() reflect.Type { 278 return reflect.TypeOf((**Framework)(nil)).Elem() 279 } 280 281 func (i *Framework) ToFrameworkOutput() FrameworkOutput { 282 return i.ToFrameworkOutputWithContext(context.Background()) 283 } 284 285 func (i *Framework) ToFrameworkOutputWithContext(ctx context.Context) FrameworkOutput { 286 return pulumi.ToOutputWithContext(ctx, i).(FrameworkOutput) 287 } 288 289 // FrameworkArrayInput is an input type that accepts FrameworkArray and FrameworkArrayOutput values. 290 // You can construct a concrete instance of `FrameworkArrayInput` via: 291 // 292 // FrameworkArray{ FrameworkArgs{...} } 293 type FrameworkArrayInput interface { 294 pulumi.Input 295 296 ToFrameworkArrayOutput() FrameworkArrayOutput 297 ToFrameworkArrayOutputWithContext(context.Context) FrameworkArrayOutput 298 } 299 300 type FrameworkArray []FrameworkInput 301 302 func (FrameworkArray) ElementType() reflect.Type { 303 return reflect.TypeOf((*[]*Framework)(nil)).Elem() 304 } 305 306 func (i FrameworkArray) ToFrameworkArrayOutput() FrameworkArrayOutput { 307 return i.ToFrameworkArrayOutputWithContext(context.Background()) 308 } 309 310 func (i FrameworkArray) ToFrameworkArrayOutputWithContext(ctx context.Context) FrameworkArrayOutput { 311 return pulumi.ToOutputWithContext(ctx, i).(FrameworkArrayOutput) 312 } 313 314 // FrameworkMapInput is an input type that accepts FrameworkMap and FrameworkMapOutput values. 315 // You can construct a concrete instance of `FrameworkMapInput` via: 316 // 317 // FrameworkMap{ "key": FrameworkArgs{...} } 318 type FrameworkMapInput interface { 319 pulumi.Input 320 321 ToFrameworkMapOutput() FrameworkMapOutput 322 ToFrameworkMapOutputWithContext(context.Context) FrameworkMapOutput 323 } 324 325 type FrameworkMap map[string]FrameworkInput 326 327 func (FrameworkMap) ElementType() reflect.Type { 328 return reflect.TypeOf((*map[string]*Framework)(nil)).Elem() 329 } 330 331 func (i FrameworkMap) ToFrameworkMapOutput() FrameworkMapOutput { 332 return i.ToFrameworkMapOutputWithContext(context.Background()) 333 } 334 335 func (i FrameworkMap) ToFrameworkMapOutputWithContext(ctx context.Context) FrameworkMapOutput { 336 return pulumi.ToOutputWithContext(ctx, i).(FrameworkMapOutput) 337 } 338 339 type FrameworkOutput struct{ *pulumi.OutputState } 340 341 func (FrameworkOutput) ElementType() reflect.Type { 342 return reflect.TypeOf((**Framework)(nil)).Elem() 343 } 344 345 func (o FrameworkOutput) ToFrameworkOutput() FrameworkOutput { 346 return o 347 } 348 349 func (o FrameworkOutput) ToFrameworkOutputWithContext(ctx context.Context) FrameworkOutput { 350 return o 351 } 352 353 // The ARN of the backup framework. 354 func (o FrameworkOutput) Arn() pulumi.StringOutput { 355 return o.ApplyT(func(v *Framework) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 356 } 357 358 // One or more control blocks that make up the framework. Each control in the list has a name, input parameters, and scope. Detailed below. 359 func (o FrameworkOutput) Controls() FrameworkControlArrayOutput { 360 return o.ApplyT(func(v *Framework) FrameworkControlArrayOutput { return v.Controls }).(FrameworkControlArrayOutput) 361 } 362 363 // The date and time that a framework is created, in Unix format and Coordinated Universal Time (UTC). 364 func (o FrameworkOutput) CreationTime() pulumi.StringOutput { 365 return o.ApplyT(func(v *Framework) pulumi.StringOutput { return v.CreationTime }).(pulumi.StringOutput) 366 } 367 368 // The deployment status of a framework. The statuses are: `CREATE_IN_PROGRESS` | `UPDATE_IN_PROGRESS` | `DELETE_IN_PROGRESS` | `COMPLETED` | `FAILED`. 369 func (o FrameworkOutput) DeploymentStatus() pulumi.StringOutput { 370 return o.ApplyT(func(v *Framework) pulumi.StringOutput { return v.DeploymentStatus }).(pulumi.StringOutput) 371 } 372 373 // The description of the framework with a maximum of 1,024 characters 374 func (o FrameworkOutput) Description() pulumi.StringPtrOutput { 375 return o.ApplyT(func(v *Framework) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput) 376 } 377 378 // The unique name of the framework. The name must be between 1 and 256 characters, starting with a letter, and consisting of letters, numbers, and underscores. 379 func (o FrameworkOutput) Name() pulumi.StringOutput { 380 return o.ApplyT(func(v *Framework) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 381 } 382 383 // A framework consists of one or more controls. Each control governs a resource, such as backup plans, backup selections, backup vaults, or recovery points. You can also turn AWS Config recording on or off for each resource. For more information refer to the [AWS documentation for Framework Status](https://docs.aws.amazon.com/aws-backup/latest/devguide/API_DescribeFramework.html#Backup-DescribeFramework-response-FrameworkStatus) 384 func (o FrameworkOutput) Status() pulumi.StringOutput { 385 return o.ApplyT(func(v *Framework) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput) 386 } 387 388 // Metadata that you can assign to help organize the frameworks you create. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 389 func (o FrameworkOutput) Tags() pulumi.StringMapOutput { 390 return o.ApplyT(func(v *Framework) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 391 } 392 393 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 394 // 395 // Deprecated: Please use `tags` instead. 396 func (o FrameworkOutput) TagsAll() pulumi.StringMapOutput { 397 return o.ApplyT(func(v *Framework) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 398 } 399 400 type FrameworkArrayOutput struct{ *pulumi.OutputState } 401 402 func (FrameworkArrayOutput) ElementType() reflect.Type { 403 return reflect.TypeOf((*[]*Framework)(nil)).Elem() 404 } 405 406 func (o FrameworkArrayOutput) ToFrameworkArrayOutput() FrameworkArrayOutput { 407 return o 408 } 409 410 func (o FrameworkArrayOutput) ToFrameworkArrayOutputWithContext(ctx context.Context) FrameworkArrayOutput { 411 return o 412 } 413 414 func (o FrameworkArrayOutput) Index(i pulumi.IntInput) FrameworkOutput { 415 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Framework { 416 return vs[0].([]*Framework)[vs[1].(int)] 417 }).(FrameworkOutput) 418 } 419 420 type FrameworkMapOutput struct{ *pulumi.OutputState } 421 422 func (FrameworkMapOutput) ElementType() reflect.Type { 423 return reflect.TypeOf((*map[string]*Framework)(nil)).Elem() 424 } 425 426 func (o FrameworkMapOutput) ToFrameworkMapOutput() FrameworkMapOutput { 427 return o 428 } 429 430 func (o FrameworkMapOutput) ToFrameworkMapOutputWithContext(ctx context.Context) FrameworkMapOutput { 431 return o 432 } 433 434 func (o FrameworkMapOutput) MapIndex(k pulumi.StringInput) FrameworkOutput { 435 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Framework { 436 return vs[0].(map[string]*Framework)[vs[1].(string)] 437 }).(FrameworkOutput) 438 } 439 440 func init() { 441 pulumi.RegisterInputType(reflect.TypeOf((*FrameworkInput)(nil)).Elem(), &Framework{}) 442 pulumi.RegisterInputType(reflect.TypeOf((*FrameworkArrayInput)(nil)).Elem(), FrameworkArray{}) 443 pulumi.RegisterInputType(reflect.TypeOf((*FrameworkMapInput)(nil)).Elem(), FrameworkMap{}) 444 pulumi.RegisterOutputType(FrameworkOutput{}) 445 pulumi.RegisterOutputType(FrameworkArrayOutput{}) 446 pulumi.RegisterOutputType(FrameworkMapOutput{}) 447 }