Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent pattern for AWS::Backup::BackupSelection BackupSelection.SelectionName property in eu-central-1 #118

Open
calebplum opened this issue Mar 11, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@calebplum
Copy link

calebplum commented Mar 11, 2021

Hi,

I noticed the pattern requirement for the BackupSelection.SelectionName property of the AWS::Backup::BackupSelection resource in eu-central-1 is different to other regions.

The schema definitions for this property are as follows:

eu-central-1

"SelectionName" : {
  "type" : "string",
  "pattern" : "^[a-zA-Z0-9\\-\\_\\.]{1,50}$"
}

us-west-1

"SelectionName" : {
  "type" : "string"
}

ap-southeast-2

"SelectionName" : {
  "type" : "string"
}

Other regions appear to be consistent with us-west-1 and ap-southeast-2, having no pattern requirement.

The impact of this is that we cannot deploy BackupSelection resources in eu-central-1 with the same SelectionName as those in other regions. I think the schema in eu-central-1 must have been changed recently because we still have stacks deployed there which violate the pattern, we're unable to update those stacks without modifying the SelectionName.

@anshikg anshikg added the bug Something isn't working label Mar 11, 2021
@pavbollu
Copy link

pavbollu commented Mar 11, 2021

@calebplum Currently backup service is using that pattern for selection name https://docs.aws.amazon.com/aws-backup/latest/devguide/API_BackupSelection.html . Could you please provide the SelectionName used for updating. Could you please provide the backup plan arn, stack arn as well. Based on the details provided we will look into it and get back

@calebplum
Copy link
Author

The resource schema for eu-central-1 has been updated and no longer contains the pattern requirement.

@calebplum
Copy link
Author

calebplum commented Mar 16, 2021

I believe the documentation at https://docs.aws.amazon.com/aws-backup/latest/devguide/API_BackupSelection.html is incorrect because Cloudformation will successfully create a AWS::Backup::BackupSelection resource with a whitespace character in the SelectionName field, which violates its regex pattern according to the documentation.

For example, this template will deploy without issues:

AWSTemplateFormatVersion: '2010-09-09'
Resources:

  IamRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Version: "2012-10-17"
        Statement:
          - Effect: Allow
            Principal:
              Service:
                - backup.amazonaws.com
            Action:
              - 'sts:AssumeRole'
      ManagedPolicyArns: 
        - arn:aws:iam::aws:policy/service-role/AWSBackupServiceRolePolicyForBackup

  BackupVault:
    Type: AWS::Backup::BackupVault
    Properties:
      BackupVaultName: test-vault

  BackupPlan:
    Type: AWS::Backup::BackupPlan
    Properties:
      BackupPlan:
        BackupPlanName: test-plan
        BackupPlanRule:
          - RuleName: test-plan-rule
            TargetBackupVault: !Ref BackupVault

  BackupSelection:
    Type: AWS::Backup::BackupSelection
    Properties:
      BackupPlanId: !GetAtt BackupPlan.BackupPlanId
      BackupSelection:
        IamRoleArn: !GetAtt IamRole.Arn
        SelectionName: 'Test Selection'
        ListOfTags:
          - ConditionKey: test-key
            ConditionType: STRINGEQUALS
            ConditionValue: test-value

@calebplum calebplum reopened this Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants