github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/amp/scraper.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 amp 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 // ## Import 16 // 17 // Using `pulumi import`, import the Managed Scraper using its identifier. 18 // For example: 19 // 20 // ```sh 21 // $ pulumi import aws:amp/scraper:Scraper example s-0123abc-0000-0123-a000-000000000000 22 // ``` 23 type Scraper struct { 24 pulumi.CustomResourceState 25 26 // a name to associate with the managed scraper. This is for your use, and does not need to be unique. 27 Alias pulumi.StringPtrOutput `pulumi:"alias"` 28 // The Amazon Resource Name (ARN) of the new scraper. 29 Arn pulumi.StringOutput `pulumi:"arn"` 30 // Configuration block for the managed scraper to send metrics to. See `destination`. 31 Destination ScraperDestinationPtrOutput `pulumi:"destination"` 32 // The Amazon Resource Name (ARN) of the IAM role that provides permissions for the scraper to discover, collect, and produce metrics 33 RoleArn pulumi.StringOutput `pulumi:"roleArn"` 34 // The configuration file to use in the new scraper. For more information, see [Scraper configuration](https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-collector-how-to.html#AMP-collector-configuration). 35 ScrapeConfiguration pulumi.StringOutput `pulumi:"scrapeConfiguration"` 36 // Configuration block to specify where the managed scraper will collect metrics from. See `source`. 37 // 38 // The following arguments are optional: 39 Source ScraperSourcePtrOutput `pulumi:"source"` 40 Tags pulumi.StringMapOutput `pulumi:"tags"` 41 // Deprecated: Please use `tags` instead. 42 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 43 Timeouts ScraperTimeoutsPtrOutput `pulumi:"timeouts"` 44 } 45 46 // NewScraper registers a new resource with the given unique name, arguments, and options. 47 func NewScraper(ctx *pulumi.Context, 48 name string, args *ScraperArgs, opts ...pulumi.ResourceOption) (*Scraper, error) { 49 if args == nil { 50 return nil, errors.New("missing one or more required arguments") 51 } 52 53 if args.ScrapeConfiguration == nil { 54 return nil, errors.New("invalid value for required argument 'ScrapeConfiguration'") 55 } 56 opts = internal.PkgResourceDefaultOpts(opts) 57 var resource Scraper 58 err := ctx.RegisterResource("aws:amp/scraper:Scraper", name, args, &resource, opts...) 59 if err != nil { 60 return nil, err 61 } 62 return &resource, nil 63 } 64 65 // GetScraper gets an existing Scraper resource's state with the given name, ID, and optional 66 // state properties that are used to uniquely qualify the lookup (nil if not required). 67 func GetScraper(ctx *pulumi.Context, 68 name string, id pulumi.IDInput, state *ScraperState, opts ...pulumi.ResourceOption) (*Scraper, error) { 69 var resource Scraper 70 err := ctx.ReadResource("aws:amp/scraper:Scraper", name, id, state, &resource, opts...) 71 if err != nil { 72 return nil, err 73 } 74 return &resource, nil 75 } 76 77 // Input properties used for looking up and filtering Scraper resources. 78 type scraperState struct { 79 // a name to associate with the managed scraper. This is for your use, and does not need to be unique. 80 Alias *string `pulumi:"alias"` 81 // The Amazon Resource Name (ARN) of the new scraper. 82 Arn *string `pulumi:"arn"` 83 // Configuration block for the managed scraper to send metrics to. See `destination`. 84 Destination *ScraperDestination `pulumi:"destination"` 85 // The Amazon Resource Name (ARN) of the IAM role that provides permissions for the scraper to discover, collect, and produce metrics 86 RoleArn *string `pulumi:"roleArn"` 87 // The configuration file to use in the new scraper. For more information, see [Scraper configuration](https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-collector-how-to.html#AMP-collector-configuration). 88 ScrapeConfiguration *string `pulumi:"scrapeConfiguration"` 89 // Configuration block to specify where the managed scraper will collect metrics from. See `source`. 90 // 91 // The following arguments are optional: 92 Source *ScraperSource `pulumi:"source"` 93 Tags map[string]string `pulumi:"tags"` 94 // Deprecated: Please use `tags` instead. 95 TagsAll map[string]string `pulumi:"tagsAll"` 96 Timeouts *ScraperTimeouts `pulumi:"timeouts"` 97 } 98 99 type ScraperState struct { 100 // a name to associate with the managed scraper. This is for your use, and does not need to be unique. 101 Alias pulumi.StringPtrInput 102 // The Amazon Resource Name (ARN) of the new scraper. 103 Arn pulumi.StringPtrInput 104 // Configuration block for the managed scraper to send metrics to. See `destination`. 105 Destination ScraperDestinationPtrInput 106 // The Amazon Resource Name (ARN) of the IAM role that provides permissions for the scraper to discover, collect, and produce metrics 107 RoleArn pulumi.StringPtrInput 108 // The configuration file to use in the new scraper. For more information, see [Scraper configuration](https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-collector-how-to.html#AMP-collector-configuration). 109 ScrapeConfiguration pulumi.StringPtrInput 110 // Configuration block to specify where the managed scraper will collect metrics from. See `source`. 111 // 112 // The following arguments are optional: 113 Source ScraperSourcePtrInput 114 Tags pulumi.StringMapInput 115 // Deprecated: Please use `tags` instead. 116 TagsAll pulumi.StringMapInput 117 Timeouts ScraperTimeoutsPtrInput 118 } 119 120 func (ScraperState) ElementType() reflect.Type { 121 return reflect.TypeOf((*scraperState)(nil)).Elem() 122 } 123 124 type scraperArgs struct { 125 // a name to associate with the managed scraper. This is for your use, and does not need to be unique. 126 Alias *string `pulumi:"alias"` 127 // Configuration block for the managed scraper to send metrics to. See `destination`. 128 Destination *ScraperDestination `pulumi:"destination"` 129 // The configuration file to use in the new scraper. For more information, see [Scraper configuration](https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-collector-how-to.html#AMP-collector-configuration). 130 ScrapeConfiguration string `pulumi:"scrapeConfiguration"` 131 // Configuration block to specify where the managed scraper will collect metrics from. See `source`. 132 // 133 // The following arguments are optional: 134 Source *ScraperSource `pulumi:"source"` 135 Tags map[string]string `pulumi:"tags"` 136 Timeouts *ScraperTimeouts `pulumi:"timeouts"` 137 } 138 139 // The set of arguments for constructing a Scraper resource. 140 type ScraperArgs struct { 141 // a name to associate with the managed scraper. This is for your use, and does not need to be unique. 142 Alias pulumi.StringPtrInput 143 // Configuration block for the managed scraper to send metrics to. See `destination`. 144 Destination ScraperDestinationPtrInput 145 // The configuration file to use in the new scraper. For more information, see [Scraper configuration](https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-collector-how-to.html#AMP-collector-configuration). 146 ScrapeConfiguration pulumi.StringInput 147 // Configuration block to specify where the managed scraper will collect metrics from. See `source`. 148 // 149 // The following arguments are optional: 150 Source ScraperSourcePtrInput 151 Tags pulumi.StringMapInput 152 Timeouts ScraperTimeoutsPtrInput 153 } 154 155 func (ScraperArgs) ElementType() reflect.Type { 156 return reflect.TypeOf((*scraperArgs)(nil)).Elem() 157 } 158 159 type ScraperInput interface { 160 pulumi.Input 161 162 ToScraperOutput() ScraperOutput 163 ToScraperOutputWithContext(ctx context.Context) ScraperOutput 164 } 165 166 func (*Scraper) ElementType() reflect.Type { 167 return reflect.TypeOf((**Scraper)(nil)).Elem() 168 } 169 170 func (i *Scraper) ToScraperOutput() ScraperOutput { 171 return i.ToScraperOutputWithContext(context.Background()) 172 } 173 174 func (i *Scraper) ToScraperOutputWithContext(ctx context.Context) ScraperOutput { 175 return pulumi.ToOutputWithContext(ctx, i).(ScraperOutput) 176 } 177 178 // ScraperArrayInput is an input type that accepts ScraperArray and ScraperArrayOutput values. 179 // You can construct a concrete instance of `ScraperArrayInput` via: 180 // 181 // ScraperArray{ ScraperArgs{...} } 182 type ScraperArrayInput interface { 183 pulumi.Input 184 185 ToScraperArrayOutput() ScraperArrayOutput 186 ToScraperArrayOutputWithContext(context.Context) ScraperArrayOutput 187 } 188 189 type ScraperArray []ScraperInput 190 191 func (ScraperArray) ElementType() reflect.Type { 192 return reflect.TypeOf((*[]*Scraper)(nil)).Elem() 193 } 194 195 func (i ScraperArray) ToScraperArrayOutput() ScraperArrayOutput { 196 return i.ToScraperArrayOutputWithContext(context.Background()) 197 } 198 199 func (i ScraperArray) ToScraperArrayOutputWithContext(ctx context.Context) ScraperArrayOutput { 200 return pulumi.ToOutputWithContext(ctx, i).(ScraperArrayOutput) 201 } 202 203 // ScraperMapInput is an input type that accepts ScraperMap and ScraperMapOutput values. 204 // You can construct a concrete instance of `ScraperMapInput` via: 205 // 206 // ScraperMap{ "key": ScraperArgs{...} } 207 type ScraperMapInput interface { 208 pulumi.Input 209 210 ToScraperMapOutput() ScraperMapOutput 211 ToScraperMapOutputWithContext(context.Context) ScraperMapOutput 212 } 213 214 type ScraperMap map[string]ScraperInput 215 216 func (ScraperMap) ElementType() reflect.Type { 217 return reflect.TypeOf((*map[string]*Scraper)(nil)).Elem() 218 } 219 220 func (i ScraperMap) ToScraperMapOutput() ScraperMapOutput { 221 return i.ToScraperMapOutputWithContext(context.Background()) 222 } 223 224 func (i ScraperMap) ToScraperMapOutputWithContext(ctx context.Context) ScraperMapOutput { 225 return pulumi.ToOutputWithContext(ctx, i).(ScraperMapOutput) 226 } 227 228 type ScraperOutput struct{ *pulumi.OutputState } 229 230 func (ScraperOutput) ElementType() reflect.Type { 231 return reflect.TypeOf((**Scraper)(nil)).Elem() 232 } 233 234 func (o ScraperOutput) ToScraperOutput() ScraperOutput { 235 return o 236 } 237 238 func (o ScraperOutput) ToScraperOutputWithContext(ctx context.Context) ScraperOutput { 239 return o 240 } 241 242 // a name to associate with the managed scraper. This is for your use, and does not need to be unique. 243 func (o ScraperOutput) Alias() pulumi.StringPtrOutput { 244 return o.ApplyT(func(v *Scraper) pulumi.StringPtrOutput { return v.Alias }).(pulumi.StringPtrOutput) 245 } 246 247 // The Amazon Resource Name (ARN) of the new scraper. 248 func (o ScraperOutput) Arn() pulumi.StringOutput { 249 return o.ApplyT(func(v *Scraper) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 250 } 251 252 // Configuration block for the managed scraper to send metrics to. See `destination`. 253 func (o ScraperOutput) Destination() ScraperDestinationPtrOutput { 254 return o.ApplyT(func(v *Scraper) ScraperDestinationPtrOutput { return v.Destination }).(ScraperDestinationPtrOutput) 255 } 256 257 // The Amazon Resource Name (ARN) of the IAM role that provides permissions for the scraper to discover, collect, and produce metrics 258 func (o ScraperOutput) RoleArn() pulumi.StringOutput { 259 return o.ApplyT(func(v *Scraper) pulumi.StringOutput { return v.RoleArn }).(pulumi.StringOutput) 260 } 261 262 // The configuration file to use in the new scraper. For more information, see [Scraper configuration](https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-collector-how-to.html#AMP-collector-configuration). 263 func (o ScraperOutput) ScrapeConfiguration() pulumi.StringOutput { 264 return o.ApplyT(func(v *Scraper) pulumi.StringOutput { return v.ScrapeConfiguration }).(pulumi.StringOutput) 265 } 266 267 // Configuration block to specify where the managed scraper will collect metrics from. See `source`. 268 // 269 // The following arguments are optional: 270 func (o ScraperOutput) Source() ScraperSourcePtrOutput { 271 return o.ApplyT(func(v *Scraper) ScraperSourcePtrOutput { return v.Source }).(ScraperSourcePtrOutput) 272 } 273 274 func (o ScraperOutput) Tags() pulumi.StringMapOutput { 275 return o.ApplyT(func(v *Scraper) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 276 } 277 278 // Deprecated: Please use `tags` instead. 279 func (o ScraperOutput) TagsAll() pulumi.StringMapOutput { 280 return o.ApplyT(func(v *Scraper) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 281 } 282 283 func (o ScraperOutput) Timeouts() ScraperTimeoutsPtrOutput { 284 return o.ApplyT(func(v *Scraper) ScraperTimeoutsPtrOutput { return v.Timeouts }).(ScraperTimeoutsPtrOutput) 285 } 286 287 type ScraperArrayOutput struct{ *pulumi.OutputState } 288 289 func (ScraperArrayOutput) ElementType() reflect.Type { 290 return reflect.TypeOf((*[]*Scraper)(nil)).Elem() 291 } 292 293 func (o ScraperArrayOutput) ToScraperArrayOutput() ScraperArrayOutput { 294 return o 295 } 296 297 func (o ScraperArrayOutput) ToScraperArrayOutputWithContext(ctx context.Context) ScraperArrayOutput { 298 return o 299 } 300 301 func (o ScraperArrayOutput) Index(i pulumi.IntInput) ScraperOutput { 302 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Scraper { 303 return vs[0].([]*Scraper)[vs[1].(int)] 304 }).(ScraperOutput) 305 } 306 307 type ScraperMapOutput struct{ *pulumi.OutputState } 308 309 func (ScraperMapOutput) ElementType() reflect.Type { 310 return reflect.TypeOf((*map[string]*Scraper)(nil)).Elem() 311 } 312 313 func (o ScraperMapOutput) ToScraperMapOutput() ScraperMapOutput { 314 return o 315 } 316 317 func (o ScraperMapOutput) ToScraperMapOutputWithContext(ctx context.Context) ScraperMapOutput { 318 return o 319 } 320 321 func (o ScraperMapOutput) MapIndex(k pulumi.StringInput) ScraperOutput { 322 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Scraper { 323 return vs[0].(map[string]*Scraper)[vs[1].(string)] 324 }).(ScraperOutput) 325 } 326 327 func init() { 328 pulumi.RegisterInputType(reflect.TypeOf((*ScraperInput)(nil)).Elem(), &Scraper{}) 329 pulumi.RegisterInputType(reflect.TypeOf((*ScraperArrayInput)(nil)).Elem(), ScraperArray{}) 330 pulumi.RegisterInputType(reflect.TypeOf((*ScraperMapInput)(nil)).Elem(), ScraperMap{}) 331 pulumi.RegisterOutputType(ScraperOutput{}) 332 pulumi.RegisterOutputType(ScraperArrayOutput{}) 333 pulumi.RegisterOutputType(ScraperMapOutput{}) 334 }