Skip to content

Commit b0dd57b

Browse files
authored
Merge pull request #204 from mackerelio-labs/elasticache_auto_retire
Allow ElastiCache to retire automatically
2 parents 75cb7e1 + e20eca1 commit b0dd57b

5 files changed

+6
-6
lines changed

docs/data-sources/aws_integration.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ data "mackerel_aws_integration" "foo" {
3939
* `enable` - Whether integration settings are enabled. Default is `true`.
4040
* `role` - The set of monitoring target’s service name or role name.
4141
* `excluded_metrics` - Metrics to exclude from integration.
42-
* `retire_automatically` - (EC2 only) Whether automatic retirement is enabled.
42+
* `retire_automatically` - (EC2, RDS and ElastiCache only) Whether automatic retirement is enabled.

docs/resources/aws_integration.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ resource "mackerel_aws_integration" "baz" {
7575
* `enable` - Whether integration settings are enabled. Default is `true`.
7676
* `role` - The set of monitoring target’s service name or role name.
7777
* `excluded_metrics` - Metrics to exclude from integration.
78-
* `retire_automatically` - (EC2 only) Whether automatic retirement is enabled.
78+
* `retire_automatically` - (EC2, RDS and ElastiCache only) Whether automatic retirement is enabled.
7979

8080
## Attributes Reference
8181

mackerel/data_source_mackerel_aws_integration.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func dataSourceMackerelAWSIntegration() *schema.Resource {
107107
},
108108
},
109109
}
110-
var supportedRetireAutomatically = map[string]bool{"ec2": true, "rds": true}
110+
var supportedRetireAutomatically = map[string]bool{"ec2": true, "rds": true, "elasticache": true}
111111
for schemaKey := range awsIntegrationServicesKey {
112112
if supportedRetireAutomatically[schemaKey] {
113113
resource.Schema[schemaKey] = awsIntegrationServiceDataSchemaWithRetireAutomatically

mackerel/resource_mackerel_aws_integration.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func resourceMackerelAWSIntegration() *schema.Resource {
149149
},
150150
},
151151
}
152-
var supportedRetireAutomatically = map[string]bool{"ec2": true, "rds": true}
152+
var supportedRetireAutomatically = map[string]bool{"ec2": true, "rds": true, "elasticache": true}
153153
for schemaKey := range awsIntegrationServicesKey {
154154
if supportedRetireAutomatically[schemaKey] {
155155
resource.Schema[schemaKey] = awsIntegrationServiceSchemaWithRetireAutomatically
@@ -231,7 +231,7 @@ func expandUpdateAWSIntegrationParam(d *schema.ResourceData) *mackerel.UpdateAWS
231231
}
232232

233233
func expandAWSIntegrationServicesSet(d *schema.ResourceData) map[string]*mackerel.AWSIntegrationService {
234-
var supportedRetireAutomatically = map[string]bool{"ec2": true, "rds": true}
234+
var supportedRetireAutomatically = map[string]bool{"ec2": true, "rds": true, "elasticache": true}
235235
services := make(map[string]*mackerel.AWSIntegrationService)
236236
for schemaKey, mapKey := range awsIntegrationServicesKey {
237237
if _, ok := d.GetOk(schemaKey); ok {

mackerel/structure_flattens.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ func flattenAWSIntegration(awsIntegration *mackerel.AWSIntegration, d *schema.Re
342342
d.Set("included_tags", awsIntegration.IncludedTags)
343343
d.Set("excluded_tags", awsIntegration.ExcludedTags)
344344

345-
var supportedRetireAutomatically = map[string]bool{"EC2": true, "RDS": true}
345+
var supportedRetireAutomatically = map[string]bool{"EC2": true, "RDS": true, "ElastiCache": true}
346346

347347
awsIntegration.Services = deleteAWSIntegrationDisableService(awsIntegration.Services)
348348
for key, service := range awsIntegration.Services {

0 commit comments

Comments
 (0)