Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AwsGreengrassProvisionerLambda] Adding existing lambda #632

Open
ruggero-balteri opened this issue Jun 9, 2020 · 1 comment
Open

[AwsGreengrassProvisionerLambda] Adding existing lambda #632

ruggero-balteri opened this issue Jun 9, 2020 · 1 comment

Comments

@ruggero-balteri
Copy link

ruggero-balteri commented Jun 9, 2020

GGP is enabled to run inside a Lambda but it only supports empty deployments
https://github.com/awslabs/aws-greengrass-provisioner/tree/master/lambda-support

Once the GGP lambda is deployed, would it be possible associate the newly created group with existing lambda functions?

Current parameters to invoke the lambda:

PAYLOAD="{ \"GroupName\": \"$GROUP_NAME\", \"CoreRoleName\": \"$CORE_ROLE_NAME\", \"ServiceRoleExists\": true, \"CorePolicyName\": \"$CORE_POLICY_NAME\" $CSR $CERTIFICATE_ARN $CREDENTIALS_JSON }"

time aws lambda invoke --function-name $LAMBDA_FUNCTION --invocation-type RequestResponse --payload "$PAYLOAD" $GROUP_NAME.outfile.txt

Expected parameters:

PAYLOAD="{ \"Mode\": "oem", \"GroupName\": \"$GROUP_NAME\", \"Deployments\": \"$S3_PATH_DEPLOYMENT_FOLDER\", \"OemPath\": \"$S3_PATH_BUILD_FOLDER\" }"

time aws lambda invoke --function-name $LAMBDA_FUNCTION --invocation-type RequestResponse --payload "$PAYLOAD" $GROUP_NAME.outfile.txt

The S3_PATH_DEPLOYMENT_FOLDER is a s3 path to a folder which contains 3 files:

  • deployment.defaults.conf
  • function.defaults.conf
  • lambda_functions.conf

A sample of the lambda_functions.conf file is as follows:

conf {
	"functions": ["~LambdaA~:live", "~LambdaB~:live" ]
}
@timmattison
Copy link
Contributor

We should discuss this further. The existing GGP Lambda design was created for partners to bootstrap Greengrass groups for customers using cross-account roles primarily. But I think it can be expanded to do more as you suggested.

Empty deployments kept the initial cross-account setup simple, but for deployments in the same account GGP should be enhanced to do what you're looking for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants