GithubHelp home page GithubHelp logo

Comments (6)

gpoitch avatar gpoitch commented on June 12, 2024 1

Perhaps try creating your bucket separately first, since you want a specific configuration.

Then when you deploy, if the Creating s3 code bucket (if necessary)... step still fails, we can add another command to explicitly check if the bucket exists first instead of relying on create-bucket to do the check.

from sammie.

gpoitch avatar gpoitch commented on June 12, 2024 1

@idkjs This should be fixed now in v0.6.7. Thanks for the report.

The auto-created bucket should now work with all regions. I tested it using eu-west-3. Regions outside us-east-1 needed additional info and I hadn't noticed because I developed using us-east-1.

The -p bucketName=x doesn't work - it should just be set in your sam.json if you ever want to change the bucket. I added that to the readme.

from sammie.

idkjs avatar idkjs commented on June 12, 2024

Thanks @gpoitch. Its not that I wanted a specific config. If i run sammie init my-app then sammie deploy i get the location error. Here is what i tried following your suggestions. My region is eu-west-3 if that helps.

aws s3 mb s3://artifacts-for-sammie-app
sammie init sammie-app
sammie deploy --s3-bucket artifacts-for-sammie-app
or just sammie deploy or sammie deploy -p --bucket artifacts-for-sammie-app

Either way get below bucket creation error.

Tries to create --bucket sam-uploads-086445346371 each time.

Full terminal.

PrisBook:sammie-app$ aws s3 mb s3://artifacts-for-sammie-app
make_bucket: artifacts-for-sammie-app
PrisBook:sammie-app$ sammie init sammie-app
[sammie] Getting AWS account id...
 aws sts get-caller-identity
[sammie] Account id: 086445346371 ✔︎
[sammie] Creating project...
[sammie] Created: "sammie-app" - template: sam.json | code: index.js ✔︎
PrisBook:sammie-app$ sammie deploy --s3-bucket artifacts-for-sammie-app
[sammie] Validating template...
 aws cloudformation validate-template --template-body file://sam.json
[sammie] Template valid ✔︎
[sammie] Creating s3 code bucket (if necessary)...
 aws s3api create-bucket --bucket sam-uploads-086445346371

An error occurred (IllegalLocationConstraintException) when calling the CreateBucket operation: Theunspecified location constraint is incompatible for the region specific endpoint this request was sent to.
Error: 255
    at ChildProcess.child.on.code (/Users/prisc_000/.npm-global/lib/node_modules/sammie/src/utils.js:21:47)
    at ChildProcess.emit (events.js:182:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
PrisBook:sammie-app$

from sammie.

gpoitch avatar gpoitch commented on June 12, 2024

If you want it to upload code to a specific s3 bucket instead of the one that gets auto-generated for you, you can change that in your sam.json under bucketName and sammie deploy will put it there.

Alternatively, you can do it this way too:
sammie deploy -p bucketName=artifacts-for-sammie-app

I'm not clear if you actually wanted to put it in a different bucket other then the auto-generated one.

from sammie.

idkjs avatar idkjs commented on June 12, 2024

@gpoitch I did not want to put it in a specific bucket. Putting it in the autogenerated bucket doesnt work with the above commands.

This is the result of running the README.md commands sammie init my-app and sammie deploy:

PrisBook:SLS$ mkd my-app
PrisBook:my-app$ sammie init my-app
[sammie] Getting AWS account id...
 aws sts get-caller-identity
[sammie] Account id: 086445346371 ✔︎
[sammie] Creating project...
[sammie] Created: "my-app" - template: sam.json | code: index.js ✔︎
PrisBook:my-app$ sammie deploy
[sammie] Validating template...
 aws cloudformation validate-template --template-body file://sam.json
[sammie] Template valid ✔︎
[sammie] Creating s3 code bucket (if necessary)...
 aws s3api create-bucket --bucket sam-uploads-086445346371

An error occurred (IllegalLocationConstraintException) when calling the CreateBucket operation: The unspecified location constraint is incompatible for the region specific endpoint this request was sent to.

Error: 255
    at ChildProcess.child.on.code (/Users/prisc_000/.npm-global/lib/node_modules/sammie/src/utils.js:21:47)
    at ChildProcess.emit (events.js:182:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
PrisBook:my-app$

So the question is, How do i deal with IllegalLocationConstraintException?

I tried passing the LocationConstraint=eu-west-3 param like so:
sammie deploy -p LocationConstraint=eu-west-3

error output:

sammie deploy -p LocationConstraint=eu-west-3
[sammie] Validating template...
 aws cloudformation validate-template --template-body file://sam.json
[sammie] Template valid ✔︎
[sammie] Creating s3 code bucket (if necessary)...
 aws s3api create-bucket --bucket sam-uploads-086445346371

An error occurred (IllegalLocationConstraintException) when calling the CreateBucket operation: The unspecified location constraint is incompatible for the region specific endpoint this request was sent to.

Error: 255
    at ChildProcess.child.on.code (/Users/prisc_000/.npm-global/lib/node_modules/sammie/src/utils.js:21:47)
    at ChildProcess.emit (events.js:182:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)

Passing bucketName param

The suggested solution returns the same error:

sammie deploy -p bucketName=artifacts-for-sammie-app

sammie deploy -p bucketName=artifacts-for-sammie-app
[sammie] Validating template...
 aws cloudformation validate-template --template-body file://sam.json
[sammie] Template valid ✔︎
[sammie] Creating s3 code bucket (if necessary)...
 aws s3api create-bucket --bucket sam-uploads-086445346371

An error occurred (IllegalLocationConstraintException) when calling the CreateBucket operation: The unspecified location constraint is incompatible for the region specific endpoint this request was sent to.

Error: 255
    at ChildProcess.child.on.code (/Users/prisc_000/.npm-global/lib/node_modules/sammie/src/utils.js:21:47)
    at ChildProcess.emit (events.js:182:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)

from sammie.

idkjs avatar idkjs commented on June 12, 2024

Nice @gpoitch. Thank you, sir.

Tested, deploying. Will update if any issues.

from sammie.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.