github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/s3control/storageLensConfiguration.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 s3control 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 an S3 Storage Lens configuration. 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" 26 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3control" 27 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 28 // 29 // ) 30 // 31 // func main() { 32 // pulumi.Run(func(ctx *pulumi.Context) error { 33 // current, err := aws.GetCallerIdentity(ctx, nil, nil) 34 // if err != nil { 35 // return err 36 // } 37 // _, err = s3control.NewStorageLensConfiguration(ctx, "example", &s3control.StorageLensConfigurationArgs{ 38 // ConfigId: pulumi.String("example-1"), 39 // StorageLensConfiguration: &s3control.StorageLensConfigurationStorageLensConfigurationArgs{ 40 // Enabled: pulumi.Bool(true), 41 // AccountLevel: &s3control.StorageLensConfigurationStorageLensConfigurationAccountLevelArgs{ 42 // ActivityMetrics: &s3control.StorageLensConfigurationStorageLensConfigurationAccountLevelActivityMetricsArgs{ 43 // Enabled: pulumi.Bool(true), 44 // }, 45 // BucketLevel: &s3control.StorageLensConfigurationStorageLensConfigurationAccountLevelBucketLevelArgs{ 46 // ActivityMetrics: &s3control.StorageLensConfigurationStorageLensConfigurationAccountLevelBucketLevelActivityMetricsArgs{ 47 // Enabled: pulumi.Bool(true), 48 // }, 49 // }, 50 // }, 51 // DataExport: &s3control.StorageLensConfigurationStorageLensConfigurationDataExportArgs{ 52 // CloudWatchMetrics: &s3control.StorageLensConfigurationStorageLensConfigurationDataExportCloudWatchMetricsArgs{ 53 // Enabled: pulumi.Bool(true), 54 // }, 55 // S3BucketDestination: &s3control.StorageLensConfigurationStorageLensConfigurationDataExportS3BucketDestinationArgs{ 56 // AccountId: pulumi.String(current.AccountId), 57 // Arn: pulumi.Any(target.Arn), 58 // Format: pulumi.String("CSV"), 59 // OutputSchemaVersion: pulumi.String("V_1"), 60 // Encryption: &s3control.StorageLensConfigurationStorageLensConfigurationDataExportS3BucketDestinationEncryptionArgs{ 61 // SseS3s: s3control.StorageLensConfigurationStorageLensConfigurationDataExportS3BucketDestinationEncryptionSseS3Array{ 62 // nil, 63 // }, 64 // }, 65 // }, 66 // }, 67 // Exclude: &s3control.StorageLensConfigurationStorageLensConfigurationExcludeArgs{ 68 // Buckets: pulumi.StringArray{ 69 // b1.Arn, 70 // b2.Arn, 71 // }, 72 // Regions: pulumi.StringArray{ 73 // pulumi.String("us-east-2"), 74 // }, 75 // }, 76 // }, 77 // }) 78 // if err != nil { 79 // return err 80 // } 81 // return nil 82 // }) 83 // } 84 // 85 // ``` 86 // <!--End PulumiCodeChooser --> 87 // 88 // ## Import 89 // 90 // Using `pulumi import`, import S3 Storage Lens configurations using the `account_id` and `config_id`, separated by a colon (`:`). For example: 91 // 92 // ```sh 93 // $ pulumi import aws:s3control/storageLensConfiguration:StorageLensConfiguration example 123456789012:example-1 94 // ``` 95 type StorageLensConfiguration struct { 96 pulumi.CustomResourceState 97 98 // The AWS account ID for the S3 Storage Lens configuration. Defaults to automatically determined account ID of the AWS provider. 99 AccountId pulumi.StringOutput `pulumi:"accountId"` 100 // The Amazon Resource Name (ARN) of the Amazon Web Services organization. 101 Arn pulumi.StringOutput `pulumi:"arn"` 102 // The ID of the S3 Storage Lens configuration. 103 ConfigId pulumi.StringOutput `pulumi:"configId"` 104 // The S3 Storage Lens configuration. See Storage Lens Configuration below for more details. 105 StorageLensConfiguration StorageLensConfigurationStorageLensConfigurationOutput `pulumi:"storageLensConfiguration"` 106 // 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. 107 Tags pulumi.StringMapOutput `pulumi:"tags"` 108 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 109 // 110 // Deprecated: Please use `tags` instead. 111 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 112 } 113 114 // NewStorageLensConfiguration registers a new resource with the given unique name, arguments, and options. 115 func NewStorageLensConfiguration(ctx *pulumi.Context, 116 name string, args *StorageLensConfigurationArgs, opts ...pulumi.ResourceOption) (*StorageLensConfiguration, error) { 117 if args == nil { 118 return nil, errors.New("missing one or more required arguments") 119 } 120 121 if args.ConfigId == nil { 122 return nil, errors.New("invalid value for required argument 'ConfigId'") 123 } 124 if args.StorageLensConfiguration == nil { 125 return nil, errors.New("invalid value for required argument 'StorageLensConfiguration'") 126 } 127 opts = internal.PkgResourceDefaultOpts(opts) 128 var resource StorageLensConfiguration 129 err := ctx.RegisterResource("aws:s3control/storageLensConfiguration:StorageLensConfiguration", name, args, &resource, opts...) 130 if err != nil { 131 return nil, err 132 } 133 return &resource, nil 134 } 135 136 // GetStorageLensConfiguration gets an existing StorageLensConfiguration resource's state with the given name, ID, and optional 137 // state properties that are used to uniquely qualify the lookup (nil if not required). 138 func GetStorageLensConfiguration(ctx *pulumi.Context, 139 name string, id pulumi.IDInput, state *StorageLensConfigurationState, opts ...pulumi.ResourceOption) (*StorageLensConfiguration, error) { 140 var resource StorageLensConfiguration 141 err := ctx.ReadResource("aws:s3control/storageLensConfiguration:StorageLensConfiguration", name, id, state, &resource, opts...) 142 if err != nil { 143 return nil, err 144 } 145 return &resource, nil 146 } 147 148 // Input properties used for looking up and filtering StorageLensConfiguration resources. 149 type storageLensConfigurationState struct { 150 // The AWS account ID for the S3 Storage Lens configuration. Defaults to automatically determined account ID of the AWS provider. 151 AccountId *string `pulumi:"accountId"` 152 // The Amazon Resource Name (ARN) of the Amazon Web Services organization. 153 Arn *string `pulumi:"arn"` 154 // The ID of the S3 Storage Lens configuration. 155 ConfigId *string `pulumi:"configId"` 156 // The S3 Storage Lens configuration. See Storage Lens Configuration below for more details. 157 StorageLensConfiguration *StorageLensConfigurationStorageLensConfiguration `pulumi:"storageLensConfiguration"` 158 // 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. 159 Tags map[string]string `pulumi:"tags"` 160 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 161 // 162 // Deprecated: Please use `tags` instead. 163 TagsAll map[string]string `pulumi:"tagsAll"` 164 } 165 166 type StorageLensConfigurationState struct { 167 // The AWS account ID for the S3 Storage Lens configuration. Defaults to automatically determined account ID of the AWS provider. 168 AccountId pulumi.StringPtrInput 169 // The Amazon Resource Name (ARN) of the Amazon Web Services organization. 170 Arn pulumi.StringPtrInput 171 // The ID of the S3 Storage Lens configuration. 172 ConfigId pulumi.StringPtrInput 173 // The S3 Storage Lens configuration. See Storage Lens Configuration below for more details. 174 StorageLensConfiguration StorageLensConfigurationStorageLensConfigurationPtrInput 175 // 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. 176 Tags pulumi.StringMapInput 177 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 178 // 179 // Deprecated: Please use `tags` instead. 180 TagsAll pulumi.StringMapInput 181 } 182 183 func (StorageLensConfigurationState) ElementType() reflect.Type { 184 return reflect.TypeOf((*storageLensConfigurationState)(nil)).Elem() 185 } 186 187 type storageLensConfigurationArgs struct { 188 // The AWS account ID for the S3 Storage Lens configuration. Defaults to automatically determined account ID of the AWS provider. 189 AccountId *string `pulumi:"accountId"` 190 // The ID of the S3 Storage Lens configuration. 191 ConfigId string `pulumi:"configId"` 192 // The S3 Storage Lens configuration. See Storage Lens Configuration below for more details. 193 StorageLensConfiguration StorageLensConfigurationStorageLensConfiguration `pulumi:"storageLensConfiguration"` 194 // 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. 195 Tags map[string]string `pulumi:"tags"` 196 } 197 198 // The set of arguments for constructing a StorageLensConfiguration resource. 199 type StorageLensConfigurationArgs struct { 200 // The AWS account ID for the S3 Storage Lens configuration. Defaults to automatically determined account ID of the AWS provider. 201 AccountId pulumi.StringPtrInput 202 // The ID of the S3 Storage Lens configuration. 203 ConfigId pulumi.StringInput 204 // The S3 Storage Lens configuration. See Storage Lens Configuration below for more details. 205 StorageLensConfiguration StorageLensConfigurationStorageLensConfigurationInput 206 // 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. 207 Tags pulumi.StringMapInput 208 } 209 210 func (StorageLensConfigurationArgs) ElementType() reflect.Type { 211 return reflect.TypeOf((*storageLensConfigurationArgs)(nil)).Elem() 212 } 213 214 type StorageLensConfigurationInput interface { 215 pulumi.Input 216 217 ToStorageLensConfigurationOutput() StorageLensConfigurationOutput 218 ToStorageLensConfigurationOutputWithContext(ctx context.Context) StorageLensConfigurationOutput 219 } 220 221 func (*StorageLensConfiguration) ElementType() reflect.Type { 222 return reflect.TypeOf((**StorageLensConfiguration)(nil)).Elem() 223 } 224 225 func (i *StorageLensConfiguration) ToStorageLensConfigurationOutput() StorageLensConfigurationOutput { 226 return i.ToStorageLensConfigurationOutputWithContext(context.Background()) 227 } 228 229 func (i *StorageLensConfiguration) ToStorageLensConfigurationOutputWithContext(ctx context.Context) StorageLensConfigurationOutput { 230 return pulumi.ToOutputWithContext(ctx, i).(StorageLensConfigurationOutput) 231 } 232 233 // StorageLensConfigurationArrayInput is an input type that accepts StorageLensConfigurationArray and StorageLensConfigurationArrayOutput values. 234 // You can construct a concrete instance of `StorageLensConfigurationArrayInput` via: 235 // 236 // StorageLensConfigurationArray{ StorageLensConfigurationArgs{...} } 237 type StorageLensConfigurationArrayInput interface { 238 pulumi.Input 239 240 ToStorageLensConfigurationArrayOutput() StorageLensConfigurationArrayOutput 241 ToStorageLensConfigurationArrayOutputWithContext(context.Context) StorageLensConfigurationArrayOutput 242 } 243 244 type StorageLensConfigurationArray []StorageLensConfigurationInput 245 246 func (StorageLensConfigurationArray) ElementType() reflect.Type { 247 return reflect.TypeOf((*[]*StorageLensConfiguration)(nil)).Elem() 248 } 249 250 func (i StorageLensConfigurationArray) ToStorageLensConfigurationArrayOutput() StorageLensConfigurationArrayOutput { 251 return i.ToStorageLensConfigurationArrayOutputWithContext(context.Background()) 252 } 253 254 func (i StorageLensConfigurationArray) ToStorageLensConfigurationArrayOutputWithContext(ctx context.Context) StorageLensConfigurationArrayOutput { 255 return pulumi.ToOutputWithContext(ctx, i).(StorageLensConfigurationArrayOutput) 256 } 257 258 // StorageLensConfigurationMapInput is an input type that accepts StorageLensConfigurationMap and StorageLensConfigurationMapOutput values. 259 // You can construct a concrete instance of `StorageLensConfigurationMapInput` via: 260 // 261 // StorageLensConfigurationMap{ "key": StorageLensConfigurationArgs{...} } 262 type StorageLensConfigurationMapInput interface { 263 pulumi.Input 264 265 ToStorageLensConfigurationMapOutput() StorageLensConfigurationMapOutput 266 ToStorageLensConfigurationMapOutputWithContext(context.Context) StorageLensConfigurationMapOutput 267 } 268 269 type StorageLensConfigurationMap map[string]StorageLensConfigurationInput 270 271 func (StorageLensConfigurationMap) ElementType() reflect.Type { 272 return reflect.TypeOf((*map[string]*StorageLensConfiguration)(nil)).Elem() 273 } 274 275 func (i StorageLensConfigurationMap) ToStorageLensConfigurationMapOutput() StorageLensConfigurationMapOutput { 276 return i.ToStorageLensConfigurationMapOutputWithContext(context.Background()) 277 } 278 279 func (i StorageLensConfigurationMap) ToStorageLensConfigurationMapOutputWithContext(ctx context.Context) StorageLensConfigurationMapOutput { 280 return pulumi.ToOutputWithContext(ctx, i).(StorageLensConfigurationMapOutput) 281 } 282 283 type StorageLensConfigurationOutput struct{ *pulumi.OutputState } 284 285 func (StorageLensConfigurationOutput) ElementType() reflect.Type { 286 return reflect.TypeOf((**StorageLensConfiguration)(nil)).Elem() 287 } 288 289 func (o StorageLensConfigurationOutput) ToStorageLensConfigurationOutput() StorageLensConfigurationOutput { 290 return o 291 } 292 293 func (o StorageLensConfigurationOutput) ToStorageLensConfigurationOutputWithContext(ctx context.Context) StorageLensConfigurationOutput { 294 return o 295 } 296 297 // The AWS account ID for the S3 Storage Lens configuration. Defaults to automatically determined account ID of the AWS provider. 298 func (o StorageLensConfigurationOutput) AccountId() pulumi.StringOutput { 299 return o.ApplyT(func(v *StorageLensConfiguration) pulumi.StringOutput { return v.AccountId }).(pulumi.StringOutput) 300 } 301 302 // The Amazon Resource Name (ARN) of the Amazon Web Services organization. 303 func (o StorageLensConfigurationOutput) Arn() pulumi.StringOutput { 304 return o.ApplyT(func(v *StorageLensConfiguration) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 305 } 306 307 // The ID of the S3 Storage Lens configuration. 308 func (o StorageLensConfigurationOutput) ConfigId() pulumi.StringOutput { 309 return o.ApplyT(func(v *StorageLensConfiguration) pulumi.StringOutput { return v.ConfigId }).(pulumi.StringOutput) 310 } 311 312 // The S3 Storage Lens configuration. See Storage Lens Configuration below for more details. 313 func (o StorageLensConfigurationOutput) StorageLensConfiguration() StorageLensConfigurationStorageLensConfigurationOutput { 314 return o.ApplyT(func(v *StorageLensConfiguration) StorageLensConfigurationStorageLensConfigurationOutput { 315 return v.StorageLensConfiguration 316 }).(StorageLensConfigurationStorageLensConfigurationOutput) 317 } 318 319 // 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. 320 func (o StorageLensConfigurationOutput) Tags() pulumi.StringMapOutput { 321 return o.ApplyT(func(v *StorageLensConfiguration) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 322 } 323 324 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 325 // 326 // Deprecated: Please use `tags` instead. 327 func (o StorageLensConfigurationOutput) TagsAll() pulumi.StringMapOutput { 328 return o.ApplyT(func(v *StorageLensConfiguration) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 329 } 330 331 type StorageLensConfigurationArrayOutput struct{ *pulumi.OutputState } 332 333 func (StorageLensConfigurationArrayOutput) ElementType() reflect.Type { 334 return reflect.TypeOf((*[]*StorageLensConfiguration)(nil)).Elem() 335 } 336 337 func (o StorageLensConfigurationArrayOutput) ToStorageLensConfigurationArrayOutput() StorageLensConfigurationArrayOutput { 338 return o 339 } 340 341 func (o StorageLensConfigurationArrayOutput) ToStorageLensConfigurationArrayOutputWithContext(ctx context.Context) StorageLensConfigurationArrayOutput { 342 return o 343 } 344 345 func (o StorageLensConfigurationArrayOutput) Index(i pulumi.IntInput) StorageLensConfigurationOutput { 346 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *StorageLensConfiguration { 347 return vs[0].([]*StorageLensConfiguration)[vs[1].(int)] 348 }).(StorageLensConfigurationOutput) 349 } 350 351 type StorageLensConfigurationMapOutput struct{ *pulumi.OutputState } 352 353 func (StorageLensConfigurationMapOutput) ElementType() reflect.Type { 354 return reflect.TypeOf((*map[string]*StorageLensConfiguration)(nil)).Elem() 355 } 356 357 func (o StorageLensConfigurationMapOutput) ToStorageLensConfigurationMapOutput() StorageLensConfigurationMapOutput { 358 return o 359 } 360 361 func (o StorageLensConfigurationMapOutput) ToStorageLensConfigurationMapOutputWithContext(ctx context.Context) StorageLensConfigurationMapOutput { 362 return o 363 } 364 365 func (o StorageLensConfigurationMapOutput) MapIndex(k pulumi.StringInput) StorageLensConfigurationOutput { 366 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *StorageLensConfiguration { 367 return vs[0].(map[string]*StorageLensConfiguration)[vs[1].(string)] 368 }).(StorageLensConfigurationOutput) 369 } 370 371 func init() { 372 pulumi.RegisterInputType(reflect.TypeOf((*StorageLensConfigurationInput)(nil)).Elem(), &StorageLensConfiguration{}) 373 pulumi.RegisterInputType(reflect.TypeOf((*StorageLensConfigurationArrayInput)(nil)).Elem(), StorageLensConfigurationArray{}) 374 pulumi.RegisterInputType(reflect.TypeOf((*StorageLensConfigurationMapInput)(nil)).Elem(), StorageLensConfigurationMap{}) 375 pulumi.RegisterOutputType(StorageLensConfigurationOutput{}) 376 pulumi.RegisterOutputType(StorageLensConfigurationArrayOutput{}) 377 pulumi.RegisterOutputType(StorageLensConfigurationMapOutput{}) 378 }