noppoMan / Hexaville

The modern serverless web application engine and framework for Swift
MIT License
125 stars 5 forks source link

`$ Hexaville deploy <ProjectName>` fails with `InvalidBucketName` #17

Closed mitsuyoshi-yamazaki closed 7 years ago

mitsuyoshi-yamazaki commented 7 years ago

Agenda

Same as title. See Error logs for detail.

How to reproduce

Follow the instructions in https://medium.com/@yukitakei/serverless-server-side-swift-with-hexaville-ef0e1788a20 until "Deploy" section.

Error logs

$ path/to/Hexaville deploy Hello
...
Uploading code to s3.....
AWSResponseError(errorCode: "InvalidBucketName", message: Optional("The specified bucket is not valid."))
An error occurred: The operation couldn’t be completed. (Core.AWSResponseError error 1.)

How to resolved

The bucket name was hexaville-Hello-bucket.

It was said..

Bucket name should conform with DNS requirements: 
- Should not contain uppercase characters <- !!
- Should not contain underscores (_)
- Should be between 3 and 63 characters long
- Should not end with a dash
- Cannot contain two, adjacent periods
- Cannot contain dashes next to periods (e.g., "my-.bucket.com" and "my.-bucket" are invalid)

# https://forums.aws.amazon.com/message.jspa?messageID=315883

I changed Hello -> hello in

then the error disappeared.

追記

書いてて思いましたがMediumの方(プロジェクト名を Hello にしている部分)を直すべきかも

noppoMan commented 7 years ago

Thanks again!

Actually I fixed this problem in https://github.com/noppoMan/Hexaville/pull/13 So Could you update Hexaville with git pull or something?

Now Bucket name format is integrated to lowercase. https://github.com/noppoMan/Hexaville/blob/master/Sources/Hexaville/main.swift#L65

And aws.lambda.bucket became required param.

name: Hello
....
  lambda:
    bucket: here is generated automatically when your Hexaville version is 0.1.4 or later
    role: xxxxxxxxx