Skip to content

Latest commit

 

History

History

lambda-cognito-metric

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

lambda-cognito-metric

AWS Lambda Function for CloudWatch Metric of Cognito User Pool POST to Mackerel.

How to use

PreRequirements

Create

cd create

(vi terraform.tfvars  # example below:)

terraform init
terraform plan
terraform apply

(terraform.tfvars example)

aws_access_key = "${ADMINISTRATOR_ACCESS_USER_ACCESS_KEY}"
aws_secret_key = "${ADMINISTRATOR_ACCESS_USER_SECRET_KEY}"
region = "ap-northeast-1"
profile = "XXXXXXX"

environment = "development"
service_name = "my-service"

Update

cd lambroll

(vi .envrc  # example below:)
direnv allow

(edit function.json : if necessary)

make dry-deploy
make deploy

(.envrc example)

export AWS_ACCESS_KEY_ID="${ADMINISTRATOR_ACCESS_USER_ACCESS_KEY}"
export AWS_SECRET_ACCESS_KEY="${ADMINISTRATOR_ACCESS_USER_SECRET_KEY}"

export AWS_DEFAULT_REGION="ap-northeast-1"

export AWS_PROFILE="XXXXXXX"


export FUNCTION_INVOKE_ROLE="arn:aws:iam::${AWS_ACCOUNT_ID}:role/lambdaCognitoMetricInvokerRole"