github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/resourceexplorer/index.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 resourceexplorer 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 a Resource Explorer index in the current AWS Region. 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/resourceexplorer" 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 := resourceexplorer.NewIndex(ctx, "example", &resourceexplorer.IndexArgs{ 33 // Type: pulumi.String("LOCAL"), 34 // }) 35 // if err != nil { 36 // return err 37 // } 38 // return nil 39 // }) 40 // } 41 // 42 // ``` 43 // <!--End PulumiCodeChooser --> 44 // 45 // ## Import 46 // 47 // Using `pulumi import`, import Resource Explorer indexes using the `arn`. For example: 48 // 49 // ```sh 50 // $ pulumi import aws:resourceexplorer/index:Index example arn:aws:resource-explorer-2:us-east-1:123456789012:index/6047ac4e-207e-4487-9bcf-cb53bb0ff5cc 51 // ``` 52 type Index struct { 53 pulumi.CustomResourceState 54 55 // Amazon Resource Name (ARN) of the Resource Explorer index. 56 Arn pulumi.StringOutput `pulumi:"arn"` 57 // 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. 58 Tags pulumi.StringMapOutput `pulumi:"tags"` 59 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 60 // 61 // Deprecated: Please use `tags` instead. 62 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 63 Timeouts IndexTimeoutsPtrOutput `pulumi:"timeouts"` 64 // The type of the index. Valid values: `AGGREGATOR`, `LOCAL`. To understand the difference between `LOCAL` and `AGGREGATOR`, see the [_AWS Resource Explorer User Guide_](https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-aggregator-region.html). 65 Type pulumi.StringOutput `pulumi:"type"` 66 } 67 68 // NewIndex registers a new resource with the given unique name, arguments, and options. 69 func NewIndex(ctx *pulumi.Context, 70 name string, args *IndexArgs, opts ...pulumi.ResourceOption) (*Index, error) { 71 if args == nil { 72 return nil, errors.New("missing one or more required arguments") 73 } 74 75 if args.Type == nil { 76 return nil, errors.New("invalid value for required argument 'Type'") 77 } 78 opts = internal.PkgResourceDefaultOpts(opts) 79 var resource Index 80 err := ctx.RegisterResource("aws:resourceexplorer/index:Index", name, args, &resource, opts...) 81 if err != nil { 82 return nil, err 83 } 84 return &resource, nil 85 } 86 87 // GetIndex gets an existing Index resource's state with the given name, ID, and optional 88 // state properties that are used to uniquely qualify the lookup (nil if not required). 89 func GetIndex(ctx *pulumi.Context, 90 name string, id pulumi.IDInput, state *IndexState, opts ...pulumi.ResourceOption) (*Index, error) { 91 var resource Index 92 err := ctx.ReadResource("aws:resourceexplorer/index:Index", name, id, state, &resource, opts...) 93 if err != nil { 94 return nil, err 95 } 96 return &resource, nil 97 } 98 99 // Input properties used for looking up and filtering Index resources. 100 type indexState struct { 101 // Amazon Resource Name (ARN) of the Resource Explorer index. 102 Arn *string `pulumi:"arn"` 103 // 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. 104 Tags map[string]string `pulumi:"tags"` 105 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 106 // 107 // Deprecated: Please use `tags` instead. 108 TagsAll map[string]string `pulumi:"tagsAll"` 109 Timeouts *IndexTimeouts `pulumi:"timeouts"` 110 // The type of the index. Valid values: `AGGREGATOR`, `LOCAL`. To understand the difference between `LOCAL` and `AGGREGATOR`, see the [_AWS Resource Explorer User Guide_](https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-aggregator-region.html). 111 Type *string `pulumi:"type"` 112 } 113 114 type IndexState struct { 115 // Amazon Resource Name (ARN) of the Resource Explorer index. 116 Arn pulumi.StringPtrInput 117 // 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. 118 Tags pulumi.StringMapInput 119 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 120 // 121 // Deprecated: Please use `tags` instead. 122 TagsAll pulumi.StringMapInput 123 Timeouts IndexTimeoutsPtrInput 124 // The type of the index. Valid values: `AGGREGATOR`, `LOCAL`. To understand the difference between `LOCAL` and `AGGREGATOR`, see the [_AWS Resource Explorer User Guide_](https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-aggregator-region.html). 125 Type pulumi.StringPtrInput 126 } 127 128 func (IndexState) ElementType() reflect.Type { 129 return reflect.TypeOf((*indexState)(nil)).Elem() 130 } 131 132 type indexArgs struct { 133 // 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. 134 Tags map[string]string `pulumi:"tags"` 135 Timeouts *IndexTimeouts `pulumi:"timeouts"` 136 // The type of the index. Valid values: `AGGREGATOR`, `LOCAL`. To understand the difference between `LOCAL` and `AGGREGATOR`, see the [_AWS Resource Explorer User Guide_](https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-aggregator-region.html). 137 Type string `pulumi:"type"` 138 } 139 140 // The set of arguments for constructing a Index resource. 141 type IndexArgs struct { 142 // 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. 143 Tags pulumi.StringMapInput 144 Timeouts IndexTimeoutsPtrInput 145 // The type of the index. Valid values: `AGGREGATOR`, `LOCAL`. To understand the difference between `LOCAL` and `AGGREGATOR`, see the [_AWS Resource Explorer User Guide_](https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-aggregator-region.html). 146 Type pulumi.StringInput 147 } 148 149 func (IndexArgs) ElementType() reflect.Type { 150 return reflect.TypeOf((*indexArgs)(nil)).Elem() 151 } 152 153 type IndexInput interface { 154 pulumi.Input 155 156 ToIndexOutput() IndexOutput 157 ToIndexOutputWithContext(ctx context.Context) IndexOutput 158 } 159 160 func (*Index) ElementType() reflect.Type { 161 return reflect.TypeOf((**Index)(nil)).Elem() 162 } 163 164 func (i *Index) ToIndexOutput() IndexOutput { 165 return i.ToIndexOutputWithContext(context.Background()) 166 } 167 168 func (i *Index) ToIndexOutputWithContext(ctx context.Context) IndexOutput { 169 return pulumi.ToOutputWithContext(ctx, i).(IndexOutput) 170 } 171 172 // IndexArrayInput is an input type that accepts IndexArray and IndexArrayOutput values. 173 // You can construct a concrete instance of `IndexArrayInput` via: 174 // 175 // IndexArray{ IndexArgs{...} } 176 type IndexArrayInput interface { 177 pulumi.Input 178 179 ToIndexArrayOutput() IndexArrayOutput 180 ToIndexArrayOutputWithContext(context.Context) IndexArrayOutput 181 } 182 183 type IndexArray []IndexInput 184 185 func (IndexArray) ElementType() reflect.Type { 186 return reflect.TypeOf((*[]*Index)(nil)).Elem() 187 } 188 189 func (i IndexArray) ToIndexArrayOutput() IndexArrayOutput { 190 return i.ToIndexArrayOutputWithContext(context.Background()) 191 } 192 193 func (i IndexArray) ToIndexArrayOutputWithContext(ctx context.Context) IndexArrayOutput { 194 return pulumi.ToOutputWithContext(ctx, i).(IndexArrayOutput) 195 } 196 197 // IndexMapInput is an input type that accepts IndexMap and IndexMapOutput values. 198 // You can construct a concrete instance of `IndexMapInput` via: 199 // 200 // IndexMap{ "key": IndexArgs{...} } 201 type IndexMapInput interface { 202 pulumi.Input 203 204 ToIndexMapOutput() IndexMapOutput 205 ToIndexMapOutputWithContext(context.Context) IndexMapOutput 206 } 207 208 type IndexMap map[string]IndexInput 209 210 func (IndexMap) ElementType() reflect.Type { 211 return reflect.TypeOf((*map[string]*Index)(nil)).Elem() 212 } 213 214 func (i IndexMap) ToIndexMapOutput() IndexMapOutput { 215 return i.ToIndexMapOutputWithContext(context.Background()) 216 } 217 218 func (i IndexMap) ToIndexMapOutputWithContext(ctx context.Context) IndexMapOutput { 219 return pulumi.ToOutputWithContext(ctx, i).(IndexMapOutput) 220 } 221 222 type IndexOutput struct{ *pulumi.OutputState } 223 224 func (IndexOutput) ElementType() reflect.Type { 225 return reflect.TypeOf((**Index)(nil)).Elem() 226 } 227 228 func (o IndexOutput) ToIndexOutput() IndexOutput { 229 return o 230 } 231 232 func (o IndexOutput) ToIndexOutputWithContext(ctx context.Context) IndexOutput { 233 return o 234 } 235 236 // Amazon Resource Name (ARN) of the Resource Explorer index. 237 func (o IndexOutput) Arn() pulumi.StringOutput { 238 return o.ApplyT(func(v *Index) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 239 } 240 241 // 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. 242 func (o IndexOutput) Tags() pulumi.StringMapOutput { 243 return o.ApplyT(func(v *Index) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 244 } 245 246 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 247 // 248 // Deprecated: Please use `tags` instead. 249 func (o IndexOutput) TagsAll() pulumi.StringMapOutput { 250 return o.ApplyT(func(v *Index) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 251 } 252 253 func (o IndexOutput) Timeouts() IndexTimeoutsPtrOutput { 254 return o.ApplyT(func(v *Index) IndexTimeoutsPtrOutput { return v.Timeouts }).(IndexTimeoutsPtrOutput) 255 } 256 257 // The type of the index. Valid values: `AGGREGATOR`, `LOCAL`. To understand the difference between `LOCAL` and `AGGREGATOR`, see the [_AWS Resource Explorer User Guide_](https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-aggregator-region.html). 258 func (o IndexOutput) Type() pulumi.StringOutput { 259 return o.ApplyT(func(v *Index) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput) 260 } 261 262 type IndexArrayOutput struct{ *pulumi.OutputState } 263 264 func (IndexArrayOutput) ElementType() reflect.Type { 265 return reflect.TypeOf((*[]*Index)(nil)).Elem() 266 } 267 268 func (o IndexArrayOutput) ToIndexArrayOutput() IndexArrayOutput { 269 return o 270 } 271 272 func (o IndexArrayOutput) ToIndexArrayOutputWithContext(ctx context.Context) IndexArrayOutput { 273 return o 274 } 275 276 func (o IndexArrayOutput) Index(i pulumi.IntInput) IndexOutput { 277 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Index { 278 return vs[0].([]*Index)[vs[1].(int)] 279 }).(IndexOutput) 280 } 281 282 type IndexMapOutput struct{ *pulumi.OutputState } 283 284 func (IndexMapOutput) ElementType() reflect.Type { 285 return reflect.TypeOf((*map[string]*Index)(nil)).Elem() 286 } 287 288 func (o IndexMapOutput) ToIndexMapOutput() IndexMapOutput { 289 return o 290 } 291 292 func (o IndexMapOutput) ToIndexMapOutputWithContext(ctx context.Context) IndexMapOutput { 293 return o 294 } 295 296 func (o IndexMapOutput) MapIndex(k pulumi.StringInput) IndexOutput { 297 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Index { 298 return vs[0].(map[string]*Index)[vs[1].(string)] 299 }).(IndexOutput) 300 } 301 302 func init() { 303 pulumi.RegisterInputType(reflect.TypeOf((*IndexInput)(nil)).Elem(), &Index{}) 304 pulumi.RegisterInputType(reflect.TypeOf((*IndexArrayInput)(nil)).Elem(), IndexArray{}) 305 pulumi.RegisterInputType(reflect.TypeOf((*IndexMapInput)(nil)).Elem(), IndexMap{}) 306 pulumi.RegisterOutputType(IndexOutput{}) 307 pulumi.RegisterOutputType(IndexArrayOutput{}) 308 pulumi.RegisterOutputType(IndexMapOutput{}) 309 }