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

Add S3 Transfer Acceleration to AWS::S3::Bucket #833

Merged

Conversation

danielpops
Copy link
Contributor

'Suspended',
]

def validate(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd remove this, and instead write a custom validator here that does the acceleration_status_values:

def validate_acceleration_status(value):
    valid_status = ["Enabled", "Suspended"]
    if value not in valid_status:
        raise ValidationError("AccelerationStatus must be one of: %s", ", ".join(valid_status))
    return value

The benefit of this is that it will take into account non-string values, such as Functions like Ref() (say someone wanted to pass this as a Parameter, for example, that'd be a Ref).

Then you can just use that validator in place of basestring.

Copy link
Member

@phobologic phobologic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

@phobologic phobologic merged commit 4bdf6c7 into cloudtools:master Oct 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants