-
Notifications
You must be signed in to change notification settings - Fork 61
Description
Name of the resource
AWS::EMRServerless::Application
Resource Name
No response
Issue Description
When using CDK to update tags on an AWS::EMRServerless::Application resource, the CloudFormation deployment fails if the application is in a STARTED state.
The error returned is:
Only MaxConcurrentRuns from SchedulerConfiguration can be updated when application is in STARTED state.
This behavior is inconsistent with both:
-
The CloudFormation documentation, which states that Tags updates require No interruption
-
The AWS console, which allows adding/removing tags while the application is running (STARTED state)
Expected Behavior
I expect cdk deploy (CloudFormation update) to succeed when adding/updating/removing tags on an EMR Serverless Application that is in a STARTED state
Observed Behavior
cdk deploy fails when the application is running.
CloudFormation attempts an UpdateApplication API call, which is rejected.
Deployment only succeeds if I manually STOP the application before running cdk deploy.
Sample CloudTrail event
"eventSource": "emr-serverless.amazonaws.com",
"eventName": "UpdateApplication",
"errorCode": "ValidationException",
"responseElements": {
"message": "Only MaxConcurrentRuns from SchedulerConfiguration can be updated when application is in STARTED state."
}
}
Test Cases
Minimal CDK example:
from aws_cdk import (
App,
Stack,
CfnTag,
aws_emrserverless as emrs
)
from constructs import Construct
class ReproStack(Stack):
def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
super().__init__(scope, construct_id, **kwargs)
emrs.CfnApplication(
self, "App",
name="repro-app",
type="SPARK",
architecture="X86_64",
releaseLabel="emr-7.10.0",
autoStartConfiguration=emrs.CfnApplication.AutoStartConfigurationProperty(enabled=True),
autoStopConfiguration=emrs.CfnApplication.AutoStopConfigurationProperty(enabled=True, idleTimeoutMinutes=15),
maximumCapacity=emrs.CfnApplication.MaximumAllowedResourcesProperty(cpu="10", memory="40", disk="200GB"),
tags=[CfnTag(key="env", value="dev")] # Change this tag and redeploy while app is STARTED -> fails
)
app = App()
ReproStack(app, "EmrServerlessTagRepro")
app.synth()
- Deploy stack with initial tags.
- Start the EMR Serverless application manually (or set auto-start).
- Change or add a tag in CDK/CFN and deploy.
- Observe failure with ValidationException
Other Details
No response