soto-project / soto

Swift SDK for AWS that works on Linux, macOS and iOS
https://soto.codes
Apache License 2.0
880 stars 83 forks source link

Aurora Serverless Cluster ARNs can have more than 100 characters. #471

Closed DwayneCoussement closed 3 years ago

DwayneCoussement commented 3 years ago

Describe the bug Aurora Serverless Cluster ARNs can have more than 100 characters.

Suggestion Change the max length to 2048 https://docs.aws.amazon.com/IAM/latest/APIReference/API_Policy.html

To Reproduce Steps to reproduce the behavior:

  1. Create a new aurora serverless cluster (via CDK for example)
    const vpc = new ec2.Vpc(this, 'SotoVPC');
    const dbName = 'SotoDB';
    const cluster = new rds.ServerlessCluster(this, 'SotoCluster', {
      engine: rds.DatabaseClusterEngine.AURORA_POSTGRESQL,
      parameterGroup: rds.ParameterGroup.fromParameterGroupName(this, 'ParameterGroup', 'default.aurora-postgresql10'),
      defaultDatabaseName: dbName,
      vpc
    });
  1. fetch clusterArn via cluster.clusterArn
  2. Make a request:
    let query = RDSDataService.ExecuteStatementRequest(database: "SotoDB", resourceArn: clusterArn, secretArn: secretArn)
    self.rds.executeStatement(query).wait()
  3. Notice you get a validation error: ValidationError: Length of ExecuteStatementRequest.resourceArn (101) is greater than the maximum allowed value 100.

Expected behavior Don't make an assumption on that the ARN will be less than 100

Setup (please complete the following information):

Additional context Add any other context about the problem here. If this a bug related to a command not working can you run the same command on a client initialised with the logging middleware. eg S3(region: .useast1, middlewares:[AWSLoggingMiddleware()])

adam-fowler commented 3 years ago

473