github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/backup/reportPlan.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 Report Plan resource. 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/backup" 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 := backup.NewReportPlan(ctx, "example", &backup.ReportPlanArgs{ 33 // Name: pulumi.String("example_name"), 34 // Description: pulumi.String("example description"), 35 // ReportDeliveryChannel: &backup.ReportPlanReportDeliveryChannelArgs{ 36 // Formats: pulumi.StringArray{ 37 // pulumi.String("CSV"), 38 // pulumi.String("JSON"), 39 // }, 40 // S3BucketName: pulumi.String("example-bucket-name"), 41 // }, 42 // ReportSetting: &backup.ReportPlanReportSettingArgs{ 43 // ReportTemplate: pulumi.String("RESTORE_JOB_REPORT"), 44 // }, 45 // Tags: pulumi.StringMap{ 46 // "Name": pulumi.String("Example Report Plan"), 47 // }, 48 // }) 49 // if err != nil { 50 // return err 51 // } 52 // return nil 53 // }) 54 // } 55 // 56 // ``` 57 // <!--End PulumiCodeChooser --> 58 // 59 // ## Import 60 // 61 // Using `pulumi import`, import Backup Report Plan using the `id` which corresponds to the name of the Backup Report Plan. For example: 62 // 63 // ```sh 64 // $ pulumi import aws:backup/reportPlan:ReportPlan test <id> 65 // ``` 66 type ReportPlan struct { 67 pulumi.CustomResourceState 68 69 // The ARN of the backup report plan. 70 Arn pulumi.StringOutput `pulumi:"arn"` 71 // The date and time that a report plan is created, in Unix format and Coordinated Universal Time (UTC). 72 CreationTime pulumi.StringOutput `pulumi:"creationTime"` 73 // The deployment status of a report plan. The statuses are: `CREATE_IN_PROGRESS` | `UPDATE_IN_PROGRESS` | `DELETE_IN_PROGRESS` | `COMPLETED`. 74 DeploymentStatus pulumi.StringOutput `pulumi:"deploymentStatus"` 75 // The description of the report plan with a maximum of 1,024 characters 76 Description pulumi.StringPtrOutput `pulumi:"description"` 77 // The unique name of the report plan. The name must be between 1 and 256 characters, starting with a letter, and consisting of letters, numbers, and underscores. 78 Name pulumi.StringOutput `pulumi:"name"` 79 // An object that contains information about where and how to deliver your reports, specifically your Amazon S3 bucket name, S3 key prefix, and the formats of your reports. Detailed below. 80 ReportDeliveryChannel ReportPlanReportDeliveryChannelOutput `pulumi:"reportDeliveryChannel"` 81 // An object that identifies the report template for the report. Reports are built using a report template. Detailed below. 82 ReportSetting ReportPlanReportSettingOutput `pulumi:"reportSetting"` 83 // Metadata that you can assign to help organize the report plans you create. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 84 Tags pulumi.StringMapOutput `pulumi:"tags"` 85 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 86 // 87 // Deprecated: Please use `tags` instead. 88 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 89 } 90 91 // NewReportPlan registers a new resource with the given unique name, arguments, and options. 92 func NewReportPlan(ctx *pulumi.Context, 93 name string, args *ReportPlanArgs, opts ...pulumi.ResourceOption) (*ReportPlan, error) { 94 if args == nil { 95 return nil, errors.New("missing one or more required arguments") 96 } 97 98 if args.ReportDeliveryChannel == nil { 99 return nil, errors.New("invalid value for required argument 'ReportDeliveryChannel'") 100 } 101 if args.ReportSetting == nil { 102 return nil, errors.New("invalid value for required argument 'ReportSetting'") 103 } 104 opts = internal.PkgResourceDefaultOpts(opts) 105 var resource ReportPlan 106 err := ctx.RegisterResource("aws:backup/reportPlan:ReportPlan", name, args, &resource, opts...) 107 if err != nil { 108 return nil, err 109 } 110 return &resource, nil 111 } 112 113 // GetReportPlan gets an existing ReportPlan resource's state with the given name, ID, and optional 114 // state properties that are used to uniquely qualify the lookup (nil if not required). 115 func GetReportPlan(ctx *pulumi.Context, 116 name string, id pulumi.IDInput, state *ReportPlanState, opts ...pulumi.ResourceOption) (*ReportPlan, error) { 117 var resource ReportPlan 118 err := ctx.ReadResource("aws:backup/reportPlan:ReportPlan", name, id, state, &resource, opts...) 119 if err != nil { 120 return nil, err 121 } 122 return &resource, nil 123 } 124 125 // Input properties used for looking up and filtering ReportPlan resources. 126 type reportPlanState struct { 127 // The ARN of the backup report plan. 128 Arn *string `pulumi:"arn"` 129 // The date and time that a report plan is created, in Unix format and Coordinated Universal Time (UTC). 130 CreationTime *string `pulumi:"creationTime"` 131 // The deployment status of a report plan. The statuses are: `CREATE_IN_PROGRESS` | `UPDATE_IN_PROGRESS` | `DELETE_IN_PROGRESS` | `COMPLETED`. 132 DeploymentStatus *string `pulumi:"deploymentStatus"` 133 // The description of the report plan with a maximum of 1,024 characters 134 Description *string `pulumi:"description"` 135 // The unique name of the report plan. The name must be between 1 and 256 characters, starting with a letter, and consisting of letters, numbers, and underscores. 136 Name *string `pulumi:"name"` 137 // An object that contains information about where and how to deliver your reports, specifically your Amazon S3 bucket name, S3 key prefix, and the formats of your reports. Detailed below. 138 ReportDeliveryChannel *ReportPlanReportDeliveryChannel `pulumi:"reportDeliveryChannel"` 139 // An object that identifies the report template for the report. Reports are built using a report template. Detailed below. 140 ReportSetting *ReportPlanReportSetting `pulumi:"reportSetting"` 141 // Metadata that you can assign to help organize the report plans you create. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 142 Tags map[string]string `pulumi:"tags"` 143 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 144 // 145 // Deprecated: Please use `tags` instead. 146 TagsAll map[string]string `pulumi:"tagsAll"` 147 } 148 149 type ReportPlanState struct { 150 // The ARN of the backup report plan. 151 Arn pulumi.StringPtrInput 152 // The date and time that a report plan is created, in Unix format and Coordinated Universal Time (UTC). 153 CreationTime pulumi.StringPtrInput 154 // The deployment status of a report plan. The statuses are: `CREATE_IN_PROGRESS` | `UPDATE_IN_PROGRESS` | `DELETE_IN_PROGRESS` | `COMPLETED`. 155 DeploymentStatus pulumi.StringPtrInput 156 // The description of the report plan with a maximum of 1,024 characters 157 Description pulumi.StringPtrInput 158 // The unique name of the report plan. The name must be between 1 and 256 characters, starting with a letter, and consisting of letters, numbers, and underscores. 159 Name pulumi.StringPtrInput 160 // An object that contains information about where and how to deliver your reports, specifically your Amazon S3 bucket name, S3 key prefix, and the formats of your reports. Detailed below. 161 ReportDeliveryChannel ReportPlanReportDeliveryChannelPtrInput 162 // An object that identifies the report template for the report. Reports are built using a report template. Detailed below. 163 ReportSetting ReportPlanReportSettingPtrInput 164 // Metadata that you can assign to help organize the report plans you create. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 165 Tags pulumi.StringMapInput 166 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 167 // 168 // Deprecated: Please use `tags` instead. 169 TagsAll pulumi.StringMapInput 170 } 171 172 func (ReportPlanState) ElementType() reflect.Type { 173 return reflect.TypeOf((*reportPlanState)(nil)).Elem() 174 } 175 176 type reportPlanArgs struct { 177 // The description of the report plan with a maximum of 1,024 characters 178 Description *string `pulumi:"description"` 179 // The unique name of the report plan. The name must be between 1 and 256 characters, starting with a letter, and consisting of letters, numbers, and underscores. 180 Name *string `pulumi:"name"` 181 // An object that contains information about where and how to deliver your reports, specifically your Amazon S3 bucket name, S3 key prefix, and the formats of your reports. Detailed below. 182 ReportDeliveryChannel ReportPlanReportDeliveryChannel `pulumi:"reportDeliveryChannel"` 183 // An object that identifies the report template for the report. Reports are built using a report template. Detailed below. 184 ReportSetting ReportPlanReportSetting `pulumi:"reportSetting"` 185 // Metadata that you can assign to help organize the report plans you create. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 186 Tags map[string]string `pulumi:"tags"` 187 } 188 189 // The set of arguments for constructing a ReportPlan resource. 190 type ReportPlanArgs struct { 191 // The description of the report plan with a maximum of 1,024 characters 192 Description pulumi.StringPtrInput 193 // The unique name of the report plan. The name must be between 1 and 256 characters, starting with a letter, and consisting of letters, numbers, and underscores. 194 Name pulumi.StringPtrInput 195 // An object that contains information about where and how to deliver your reports, specifically your Amazon S3 bucket name, S3 key prefix, and the formats of your reports. Detailed below. 196 ReportDeliveryChannel ReportPlanReportDeliveryChannelInput 197 // An object that identifies the report template for the report. Reports are built using a report template. Detailed below. 198 ReportSetting ReportPlanReportSettingInput 199 // Metadata that you can assign to help organize the report plans you create. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 200 Tags pulumi.StringMapInput 201 } 202 203 func (ReportPlanArgs) ElementType() reflect.Type { 204 return reflect.TypeOf((*reportPlanArgs)(nil)).Elem() 205 } 206 207 type ReportPlanInput interface { 208 pulumi.Input 209 210 ToReportPlanOutput() ReportPlanOutput 211 ToReportPlanOutputWithContext(ctx context.Context) ReportPlanOutput 212 } 213 214 func (*ReportPlan) ElementType() reflect.Type { 215 return reflect.TypeOf((**ReportPlan)(nil)).Elem() 216 } 217 218 func (i *ReportPlan) ToReportPlanOutput() ReportPlanOutput { 219 return i.ToReportPlanOutputWithContext(context.Background()) 220 } 221 222 func (i *ReportPlan) ToReportPlanOutputWithContext(ctx context.Context) ReportPlanOutput { 223 return pulumi.ToOutputWithContext(ctx, i).(ReportPlanOutput) 224 } 225 226 // ReportPlanArrayInput is an input type that accepts ReportPlanArray and ReportPlanArrayOutput values. 227 // You can construct a concrete instance of `ReportPlanArrayInput` via: 228 // 229 // ReportPlanArray{ ReportPlanArgs{...} } 230 type ReportPlanArrayInput interface { 231 pulumi.Input 232 233 ToReportPlanArrayOutput() ReportPlanArrayOutput 234 ToReportPlanArrayOutputWithContext(context.Context) ReportPlanArrayOutput 235 } 236 237 type ReportPlanArray []ReportPlanInput 238 239 func (ReportPlanArray) ElementType() reflect.Type { 240 return reflect.TypeOf((*[]*ReportPlan)(nil)).Elem() 241 } 242 243 func (i ReportPlanArray) ToReportPlanArrayOutput() ReportPlanArrayOutput { 244 return i.ToReportPlanArrayOutputWithContext(context.Background()) 245 } 246 247 func (i ReportPlanArray) ToReportPlanArrayOutputWithContext(ctx context.Context) ReportPlanArrayOutput { 248 return pulumi.ToOutputWithContext(ctx, i).(ReportPlanArrayOutput) 249 } 250 251 // ReportPlanMapInput is an input type that accepts ReportPlanMap and ReportPlanMapOutput values. 252 // You can construct a concrete instance of `ReportPlanMapInput` via: 253 // 254 // ReportPlanMap{ "key": ReportPlanArgs{...} } 255 type ReportPlanMapInput interface { 256 pulumi.Input 257 258 ToReportPlanMapOutput() ReportPlanMapOutput 259 ToReportPlanMapOutputWithContext(context.Context) ReportPlanMapOutput 260 } 261 262 type ReportPlanMap map[string]ReportPlanInput 263 264 func (ReportPlanMap) ElementType() reflect.Type { 265 return reflect.TypeOf((*map[string]*ReportPlan)(nil)).Elem() 266 } 267 268 func (i ReportPlanMap) ToReportPlanMapOutput() ReportPlanMapOutput { 269 return i.ToReportPlanMapOutputWithContext(context.Background()) 270 } 271 272 func (i ReportPlanMap) ToReportPlanMapOutputWithContext(ctx context.Context) ReportPlanMapOutput { 273 return pulumi.ToOutputWithContext(ctx, i).(ReportPlanMapOutput) 274 } 275 276 type ReportPlanOutput struct{ *pulumi.OutputState } 277 278 func (ReportPlanOutput) ElementType() reflect.Type { 279 return reflect.TypeOf((**ReportPlan)(nil)).Elem() 280 } 281 282 func (o ReportPlanOutput) ToReportPlanOutput() ReportPlanOutput { 283 return o 284 } 285 286 func (o ReportPlanOutput) ToReportPlanOutputWithContext(ctx context.Context) ReportPlanOutput { 287 return o 288 } 289 290 // The ARN of the backup report plan. 291 func (o ReportPlanOutput) Arn() pulumi.StringOutput { 292 return o.ApplyT(func(v *ReportPlan) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 293 } 294 295 // The date and time that a report plan is created, in Unix format and Coordinated Universal Time (UTC). 296 func (o ReportPlanOutput) CreationTime() pulumi.StringOutput { 297 return o.ApplyT(func(v *ReportPlan) pulumi.StringOutput { return v.CreationTime }).(pulumi.StringOutput) 298 } 299 300 // The deployment status of a report plan. The statuses are: `CREATE_IN_PROGRESS` | `UPDATE_IN_PROGRESS` | `DELETE_IN_PROGRESS` | `COMPLETED`. 301 func (o ReportPlanOutput) DeploymentStatus() pulumi.StringOutput { 302 return o.ApplyT(func(v *ReportPlan) pulumi.StringOutput { return v.DeploymentStatus }).(pulumi.StringOutput) 303 } 304 305 // The description of the report plan with a maximum of 1,024 characters 306 func (o ReportPlanOutput) Description() pulumi.StringPtrOutput { 307 return o.ApplyT(func(v *ReportPlan) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput) 308 } 309 310 // The unique name of the report plan. The name must be between 1 and 256 characters, starting with a letter, and consisting of letters, numbers, and underscores. 311 func (o ReportPlanOutput) Name() pulumi.StringOutput { 312 return o.ApplyT(func(v *ReportPlan) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 313 } 314 315 // An object that contains information about where and how to deliver your reports, specifically your Amazon S3 bucket name, S3 key prefix, and the formats of your reports. Detailed below. 316 func (o ReportPlanOutput) ReportDeliveryChannel() ReportPlanReportDeliveryChannelOutput { 317 return o.ApplyT(func(v *ReportPlan) ReportPlanReportDeliveryChannelOutput { return v.ReportDeliveryChannel }).(ReportPlanReportDeliveryChannelOutput) 318 } 319 320 // An object that identifies the report template for the report. Reports are built using a report template. Detailed below. 321 func (o ReportPlanOutput) ReportSetting() ReportPlanReportSettingOutput { 322 return o.ApplyT(func(v *ReportPlan) ReportPlanReportSettingOutput { return v.ReportSetting }).(ReportPlanReportSettingOutput) 323 } 324 325 // Metadata that you can assign to help organize the report plans you create. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 326 func (o ReportPlanOutput) Tags() pulumi.StringMapOutput { 327 return o.ApplyT(func(v *ReportPlan) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 328 } 329 330 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 331 // 332 // Deprecated: Please use `tags` instead. 333 func (o ReportPlanOutput) TagsAll() pulumi.StringMapOutput { 334 return o.ApplyT(func(v *ReportPlan) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 335 } 336 337 type ReportPlanArrayOutput struct{ *pulumi.OutputState } 338 339 func (ReportPlanArrayOutput) ElementType() reflect.Type { 340 return reflect.TypeOf((*[]*ReportPlan)(nil)).Elem() 341 } 342 343 func (o ReportPlanArrayOutput) ToReportPlanArrayOutput() ReportPlanArrayOutput { 344 return o 345 } 346 347 func (o ReportPlanArrayOutput) ToReportPlanArrayOutputWithContext(ctx context.Context) ReportPlanArrayOutput { 348 return o 349 } 350 351 func (o ReportPlanArrayOutput) Index(i pulumi.IntInput) ReportPlanOutput { 352 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ReportPlan { 353 return vs[0].([]*ReportPlan)[vs[1].(int)] 354 }).(ReportPlanOutput) 355 } 356 357 type ReportPlanMapOutput struct{ *pulumi.OutputState } 358 359 func (ReportPlanMapOutput) ElementType() reflect.Type { 360 return reflect.TypeOf((*map[string]*ReportPlan)(nil)).Elem() 361 } 362 363 func (o ReportPlanMapOutput) ToReportPlanMapOutput() ReportPlanMapOutput { 364 return o 365 } 366 367 func (o ReportPlanMapOutput) ToReportPlanMapOutputWithContext(ctx context.Context) ReportPlanMapOutput { 368 return o 369 } 370 371 func (o ReportPlanMapOutput) MapIndex(k pulumi.StringInput) ReportPlanOutput { 372 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ReportPlan { 373 return vs[0].(map[string]*ReportPlan)[vs[1].(string)] 374 }).(ReportPlanOutput) 375 } 376 377 func init() { 378 pulumi.RegisterInputType(reflect.TypeOf((*ReportPlanInput)(nil)).Elem(), &ReportPlan{}) 379 pulumi.RegisterInputType(reflect.TypeOf((*ReportPlanArrayInput)(nil)).Elem(), ReportPlanArray{}) 380 pulumi.RegisterInputType(reflect.TypeOf((*ReportPlanMapInput)(nil)).Elem(), ReportPlanMap{}) 381 pulumi.RegisterOutputType(ReportPlanOutput{}) 382 pulumi.RegisterOutputType(ReportPlanArrayOutput{}) 383 pulumi.RegisterOutputType(ReportPlanMapOutput{}) 384 }