|
| 1 | +package recipes |
| 2 | + |
| 3 | +import ( |
| 4 | + "github.com/aws/aws-sdk-go-v2/service/amp/types" |
| 5 | + "github.com/cloudquery/plugin-sdk/codegen" |
| 6 | + "github.com/cloudquery/plugin-sdk/schema" |
| 7 | +) |
| 8 | + |
| 9 | +func AMPResources() []*Resource { |
| 10 | + return []*Resource{ |
| 11 | + { |
| 12 | + Service: "amp", |
| 13 | + SubService: "workspaces", |
| 14 | + Struct: new(types.WorkspaceDescription), |
| 15 | + Description: "https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-APIReference.html#AMP-APIReference-WorkspaceDescription", |
| 16 | + Multiplex: `client.ServiceAccountRegionMultiplexer("amp")`, |
| 17 | + PreResourceResolver: "describeWorkspace", |
| 18 | + PKColumns: []string{"arn"}, |
| 19 | + ExtraColumns: append( |
| 20 | + defaultRegionalColumns, |
| 21 | + codegen.ColumnDefinition{ |
| 22 | + Name: "alert_manager_definition", |
| 23 | + Type: schema.TypeJSON, |
| 24 | + Resolver: `describeAlertManagerDefinition`, |
| 25 | + }, |
| 26 | + codegen.ColumnDefinition{ |
| 27 | + Name: "logging_configuration", |
| 28 | + Type: schema.TypeJSON, |
| 29 | + Resolver: `describeLoggingConfiguration`, |
| 30 | + }, |
| 31 | + ), |
| 32 | + Relations: []string{"RuleGroupsNamespaces()"}, |
| 33 | + }, |
| 34 | + { |
| 35 | + Service: "amp", |
| 36 | + SubService: "rule_groups_namespaces", |
| 37 | + Struct: new(types.RuleGroupsNamespaceDescription), |
| 38 | + Description: "https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-APIReference.html#AMP-APIReference-RuleGroupsNamespaceDescription", |
| 39 | + Multiplex: "", // relation for workspace |
| 40 | + PreResourceResolver: "describeRuleGroupsNamespace", |
| 41 | + PKColumns: []string{"arn"}, |
| 42 | + ExtraColumns: append( |
| 43 | + defaultRegionalColumns, |
| 44 | + codegen.ColumnDefinition{ |
| 45 | + Name: "workspace_arn", |
| 46 | + Type: schema.TypeString, |
| 47 | + Resolver: `schema.ParentColumnResolver("arn")`, |
| 48 | + }, |
| 49 | + ), |
| 50 | + }, |
| 51 | + } |
| 52 | +} |
0 commit comments