caastle
caastle copied to clipboard
Add constraints for names
We should make sure that environment names and application names adhere to naming constraints defined by the underlying cloud.
For instance, AWS RDS's name needs to be according to following constraints:
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Limits.html#RDS_Limits.Constraints
When creating a RDS instance for an environment, cloudark uses the name of the environment as the name of the RDS instance. So we need to adhere to the naming constraints of RDS when creating the environment otherwise we get errors like the following:
10/03/2017 09:28:06 PM Response body: <ErrorResponse xmlns="http://rds.amazonaws.com/doc/2014-10-31/"> <Error> <Type>Sender</Type> <Code>InvalidParameterValue</Code> <Message>Invalid database identifier: 03oct2-2017-10-03-21-24-17</Message> </Error> <RequestId>a8834b16-a8ab-11e7-88eb-53a6941873ad</RequestId> </ErrorResponse>
10/03/2017 09:28:06 PM Event needs-retry.rds.CreateDBInstance: calling handler <botocore.retryhandler.RetryHandler object at 0x105e65050> 10/03/2017 09:28:06 PM No retry needed. 10/03/2017 09:28:06 PM <An error occurred (InvalidParameterValue) when calling the CreateDBInstance operation: Invalid database identifier: 03oct2-2017-10-03-21-24-17>: create() /Users/vxk1803/kvr/repos/cloudark/server/server_plugins/aws/resource/rds_handler.py:25 10/03/2017 09:28:06 PM An error occurred (InvalidParameterValue) when calling the CreateDBInstance operation: Invalid database identifier: 03oct2-2017-10-03-21-24-17 Traceback (most recent call last): File "/Users/vxk1803/kvr/repos/cloudark/server/server_plugins/aws/resource/rds_handler.py", line 80, in create Tags=[{"Key":"Tag1", "Value":"Value1"}])
@vikomall ^^
We have added checks for environment name.
Keeping this issue open to track checks that we should add for container name and app name.