aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.6k stars 3.9k forks source link

Body property cannot be added to cfnApi #15754

Closed ghost closed 3 years ago

ghost commented 3 years ago

:question: General Issue

The Question

I’m in the process of creating an OpenAPI that can authenticate and approve Cognito. I added a Body to the API properties,

<stack/apiStack.ts:56>
const cfnApi = httpApi.node.defaultChild as CfnApi;
cfnApi.addPropertyOverride('Body', props.openApi);

but I get an error stating that there is no Body.

edundant fields [name="dev-○○○○○-HttpApi", protocolType="HTTP", corsConfiguration={"allowOrigins":["http://localhost:3000"],"exposeHeaders":[],"allowMethods
":["*"],"allowHeaders":["authorization"]}] provided when either Body or BodyS3Location is not empty (Service: null; Status Code: 0; Error Code: null; Request ID:
null; Proxy: null) (Service: null; Status Code: 404; Error Code: BadRequestException; Request ID: null; Proxy: null)
Does anyone know the cause?

The working branch where the phenomenon is occurring is the link below. https://github.com/yogarasu/todolist/tree/feature/add-api

Environment

Other information

peterwoodworth commented 3 years ago

How are you creating your HttpApi and what other configuration do you have for it?

ghost commented 3 years ago

Sorry, I misunderstood that HttpApi supports the body property. https://github.com/aws/aws-cdk/issues/11373

github-actions[bot] commented 3 years ago

⚠️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.