-
Notifications
You must be signed in to change notification settings - Fork 4.5k
stepfunctions-tasks: mediapackagevod service generates wrong action in role policy #28774
Copy link
Copy link
Closed
Labels
@aws-cdk/aws-iamRelated to AWS Identity and Access ManagementRelated to AWS Identity and Access Management@aws-cdk/aws-stepfunctions-tasksbugThis issue is a bug.This issue is a bug.effort/mediumMedium work item – several days of effortMedium work item – several days of effortp2
Description
Describe the bug
Following code is properly creates a step in Step Functions
new sfn_tasks.CallAwsService(stack, 'DeleteMediaPackageVoDAsset', {
service: 'mediapackagevod',
action: 'deleteAsset',
resultPath: sfn.JsonPath.DISCARD,
iamResources: ['*'],
});However, it creates wrong statement in the role policy.
{
"Action": "mediapackagevod:deleteAsset",
"Resource": "*",
"Effect": "Allow"
}Correct service prefix for MediaPackageVoD is mediapackage-vod.
https://docs.aws.amazon.com/service-authorization/latest/reference/list_awselementalmediapackagevod.html
This issue is similar with #27573 and #28081.
Expected Behavior
Action should be mediapackage-vod:deleteAsset
Current Behavior
Action is mediapackagevod:deleteAsset
Reproduction Steps
Sample code for reproduction is below:
import * as cdk from 'aws-cdk-lib';
import { Construct } from 'constructs';
import {
aws_stepfunctions as sfn,
aws_stepfunctions_tasks as sfn_tasks,
} from 'aws-cdk-lib';
export class SfnMediaPackageVoDStack extends cdk.Stack {
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const deleteAsset = new sfn_tasks.CallAwsService(stack, 'DeleteMediaPackageVoDAsset', {
service: 'mediapackagevod',
action: 'deleteAsset',
resultPath: sfn.JsonPath.DISCARD,
iamResources: ['*'],
});
new sfn.StateMachine(this, 'SimpleStateMachine', {
definitionBody: sfn.DefinitionBody.fromChainable(deleteAsset)
});
}
}Possible Solution
aws-cdk/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/aws-sdk/call-aws-service.ts
Additional Information/Context
No response
CDK CLI Version
2.122.0
Framework Version
No response
Node.js Version
v18.19.0
OS
MacOS
Language
TypeScript
Language Version
No response
Other information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-iamRelated to AWS Identity and Access ManagementRelated to AWS Identity and Access Management@aws-cdk/aws-stepfunctions-tasksbugThis issue is a bug.This issue is a bug.effort/mediumMedium work item – several days of effortMedium work item – several days of effortp2