chalice icon indicating copy to clipboard operation
chalice copied to clipboard

Use config.json with chalice package

Open rapidoo opened this issue 8 years ago • 2 comments

I want to deploy my package with chalice package in order to use CloudFormation https://chalice.readthedocs.io/en/latest/topics/cfn.html?highlight=package

it seem that the job don't use my config.json to use the arn role I expect

"manage_iam_role" : false, "iam_role_arn" : "arn:aws:iam:*********

because sam.json is generated with an DefaultRolePolicy

cmd : chalice package ./tmp2 --stage prod

config.json : { "version": "2.0", "app_name": "XXXXXXX", "stages": { "dev": { "api_gateway_stage": "api", "lambda_timeout": 120, "lambda_memory_size": 1024, "manage_iam_role" : false, "iam_role_arn" : "arn:aws:iam:::role/lambda_dynamodb_s3" }}, "prod": { "api_gateway_stage": "api", "lambda_timeout": 120, "lambda_memory_size": 1024, "manage_iam_role" : false, "iam_role_arn" : "arn:aws:iam::*:role/lambda_dynamodb_s3" } }

rapidoo avatar Aug 03 '18 15:08 rapidoo

To prevent the generation of the default role use autogen_policy config. But are you sure that the generated role is used for your API handler in the sam file and not your specified role?

gallmerci avatar Aug 03 '18 19:08 gallmerci

Thanks, but in fact chalice is right and my config false :(

}}, "prod": {

the prod item is not in stages !!

The point is chalice could display an error when dealing with an unkown stage

rapidoo avatar Aug 06 '18 07:08 rapidoo