Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cloudformation.CfnStackSet.ManagedExecutionProperty: extraneous key [active] is not permitted #26152

Closed
savagete2860 opened this issue Jun 28, 2023 · 4 comments
Labels
@aws-cdk/aws-cloudformation Related to AWS CloudFormation bug This issue is a bug. effort/small Small work item – less than a day of effort p2

Comments

@savagete2860
Copy link

Describe the bug

I am writing CDK in Python 3.10 which deploys a stackset. It seems there is currently a bug in ManagedExecutionProperty where you can not specify this property without getting an extraneous key error.

Example construct:

class CrenelStackSet(Construct):
    def __init__(self, scope: Construct, id_: str):
        super().__init__(scope, id_)
        self.stack_set = cloudformation.CfnStackSet(
            self, 'stackset',
            permission_model='SERVICE_MANAGED',
            call_as='DELEGATED_ADMIN',
            stack_set_name='test-stack-set,
            managed_execution=cloudformation.CfnStackSet.ManagedExecutionProperty(active=False),
            operation_preferences=cloudformation.CfnStackSet.OperationPreferencesProperty(
                failure_tolerance_percentage=100,
                max_concurrent_percentage=100
            ),
            stack_instances_group=[cloudformation.CfnStackSet.StackInstancesProperty(
                deployment_targets=cloudformation.CfnStackSet.DeploymentTargetsProperty(
                    organizational_unit_ids='ou-xxx',
                ),
                regions=['region']
            )],
            template_body=template
        )

This will synth fine but when deploying the following error causes a rollback:
#/ManagedExecution: extraneous key [active] is not permitted

The synth'd template looks like:

    "ManagedExecution": {
     "active": true
    },

I think the a in active is supposed to be capitalized like:

    "ManagedExecution": {
     "Active": true
    },

Expected Behavior

No errors when using ManagedExecutionProperty

Current Behavior

Using ManagedExecutionProperty will always result in the error: ManagedExecution: extraneous key [active] is not permitted

Reproduction Steps

Create a stackset using cdk and specify the managed_execution argument.

Possible Solution

Make the the word active synth to Active in the template.

Additional Information/Context

No response

CDK CLI Version

2.85.0

Framework Version

No response

Node.js Version

18.x.x

OS

macos

Language

Python

Language Version

Python 3.10

Other information

No response

@savagete2860 savagete2860 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 28, 2023
@github-actions github-actions bot added the @aws-cdk/aws-cloudformation Related to AWS CloudFormation label Jun 28, 2023
@pahud
Copy link
Contributor

pahud commented Jun 28, 2023

managed_execution is type Any(doc) so I believe you will need to pass the JSON like

managed_execution={
    "Active": true
}

@pahud pahud added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. p2 effort/small Small work item – less than a day of effort and removed needs-triage This issue or PR still needs to be triaged. labels Jun 28, 2023
@savagete2860
Copy link
Author

managed_execution is type Any(doc) so I believe you will need to pass the JSON like

managed_execution={
    "Active": true
}

Thank you that worked. I was using the example found here.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jun 28, 2023
@peterwoodworth
Copy link
Contributor

We hope to make those docs accurate in the future by allowing that way of specifying this when an any type is expected. Sorry for the confusion

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-cloudformation Related to AWS CloudFormation bug This issue is a bug. effort/small Small work item – less than a day of effort p2
Projects
None yet
Development

No branches or pull requests

3 participants