Skip to content

bug: lambda Add permission accepts non-compliant statement IDs #7763

@wunderbarb

Description

@wunderbarb

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Statement ID should be [0-9a-zA-z_/-]+ but localstack accepts for instance "example.com"

Expected Behavior

No response

How are you starting LocalStack?

With a docker run command

Steps To Reproduce

	c := lambda.NewFromConfig(cfg)
	api := &lambda.AddPermissionInput{
		Action:              aws.String("lambda:InvokeFunction"),
		FunctionName:        aws.String(arn),
		Principal:           aws.String("events.amazonaws.com"),
		StatementId:         aws.String("example.com),
		EventSourceToken:    nil,
		FunctionUrlAuthType: "",
		PrincipalOrgID:      nil,
		Qualifier:           nil,
		RevisionId:          nil,
		SourceAccount:       nil,
		SourceArn:           aws.String(rnARN),
	}
	_, err = c.AddPermission(context.Background(), api)

Environment

- OS: Ubuntu 20.04
- LocalStack: 1.4.0  pro

Anything else?

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions