aws-cloudformation / cloudformation-coverage-roadmap

The AWS CloudFormation Public Coverage Roadmap
https://aws.amazon.com/cloudformation/
Creative Commons Attribution Share Alike 4.0 International
1.1k stars 53 forks source link

AWS::InternetMonitor::Monitor initial `INACTIVE` status is not considered #1985

Closed yvele closed 2 months ago

yvele commented 3 months ago

Name of the resource

Other

Resource Name

AWS::InternetMonitor::Monitor

Issue Description

When creating a new CloudWatch Internet Monitor with an INACTIVE status:

InternetMonitor:
  Type: AWS::InternetMonitor::Monitor
  Properties:
    MonitorName: Test
    Status: INACTIVE

the resource is created as active despite that fact that I asked for an INACTIVE one:

image

The documentation says that:

The status of a monitor. The accepted values that you can specify for Status are ACTIVE and INACTIVE.

It's probably because during creation the status starts as PENDING. But I still need the ability to create the monitor as INACTIVE.

Expected Behavior

When creating a new CloudWatch Internet Monitor with an INACTIVE status:

InternetMonitor:
  Type: AWS::InternetMonitor::Monitor
  Properties:
    MonitorName: Test
    Status: INACTIVE

the created resource SHOULD be INACTIVE:

image

Observed Behavior

image

Test Cases

Just create any new AWS::InternetMonitor::Monitor with initial Status: INACTIVE.

Other Details

Please note that, upon updating any property other than Status at a later time (for example, MaxCityNetworksToMonitor), the status unexpectedly becomes inactive, despite not modifying the initial Status: INACTIVE property. 🤔

image

Also please fix the documentation: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-internetmonitor-monitor.html#cfn-internetmonitor-monitor-status

- Allowed values: PENDING | ACTIVE | INACTIVE | ERROR
+ Allowed values: ACTIVE | INACTIVE
njmullenamazon commented 3 months ago

Reviewing this - it seems that this is an inconsistency where the API does not accept a "Status" parameter, so all monitors are created as "ACTIVE" by default.

We will update the CloudFormation behavior to update the monitor's status to "INACTIVE" after monitor creation, if the status is set to "INACTIVE" in the template.

As far as the "Other Details" this is a side effect of the current behavior. When making an update call, CloudFormation notices that the status should be INACTIVE and performs that update accordingly.

Will prioritize this bug fix in the coming weeks. Please let me know if you need any additional info/if this is a higher priority. Thanks!

yvele commented 3 months ago

Will prioritize this bug fix in the coming weeks. Please let me know if you need any additional info/if this is a higher priority.

For me, the urgency is moderate since I noticed the problem in the console. This was fortunate, as it could have resulted in an unexpected surprise at the end of the month upon reviewing the bill.

njmullenamazon commented 2 months ago

This has been updated such that if the status is set to INACTIVE in the template, the monitor will be updated to INACTIVE status after its creation.

Please don't hesitate to reach out if you have any further questions or feedback. Thanks!