Closed suzhoum closed 1 year ago
can you try passing the role, instead of the profile? I'm surprised that even compiles. Eg turn this:
compute_environment = batch.ManagedEc2EcsComputeEnvironment(self, f"{prefix}-compute-environment",
instance_role=batch_instance_profile,
// ...
)
into this:
compute_environment = batch.ManagedEc2EcsComputeEnvironment(self, f"{prefix}-compute-environment",
instance_role=batch_instance_role,
// ...
)
@comcalvi thanks for your response! I tried but still got the same error. We used instance_role=batch_instance_profile.profile_arn
in 2.69.0 and it worked, so we kept the similar thing in the code.
@suzhoum can you share your lambda function's CDK definition on both versions? How does it relate to the CE?
Still facing the issue as of v2.89.0
This is another reason to add grant methods
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.
Describe the bug
I'm trying to upgrade from 2.69.0 to the latest 2.78.0, and encountered an issue when trying to perform
batch:SubmitJob
from a lambda function. The error message isExpected Behavior
Lambda function should be able to perform
batch:SubmitJob
after the upgrade tov2.79.0
Current Behavior
I tried my best to update my code to generate the exact same cloudformation template that was generated in 2.69.0, but still there are some major differences.
I'm posting the code snippet that we have changed in this project in order to upgrade:
in
v2.69.0
:in
v2.79.0
The key difference I see in the generated CFN from above code snippets are, in
v2.79.0
, there arecontainerdefinitionExecutionRole
andcontainerdefinitionExecutionRoleDefaultPolicy
created:"AWS::Batch::ComputeEnvironment"
has two more properties inv2.79.0
The Lambda function's CFN remained unchanged.
Reproduction Steps
See above
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.79.9
Framework Version
No response
Node.js Version
v18.13.0
OS
ubuntu
Language
Python
Language Version
No response
Other information
No response