unity-sds / unity-data-services

Apache License 2.0
0 stars 3 forks source link

Name of SSM parameter to store DAPA lambda function needs to be unique #184

Closed ngachung closed 1 year ago

ngachung commented 1 year ago

The following ssm parameter name does not allow for multiple deployments in the same AWS account as the following error is encountered during deployment

Error: error creating SSM parameter (/unity/unity-ds/api-gateway/integrations/collections-dapa-function-name): ParameterAlreadyExists: The parameter already exists. To overwrite this value, set the overwrite option in the request to true.

  on .terraform/modules/unity_cumulus_lambda/main.tf line 214, in resource "aws_ssm_parameter" "cumulus_collections_dapa_ssm_param":
 214: resource "aws_ssm_parameter" "cumulus_collections_dapa_ssm_param" {
resource "aws_ssm_parameter" "cumulus_collections_dapa_ssm_param" {
  name  = "/unity/unity-ds/api-gateway/integrations/collections-dapa-function-name"
  type  = "String"
  value = aws_lambda_function.cumulus_collections_dapa.function_name
}

resource "aws_ssm_parameter" "cumulus_collections_create_dapa_ssm_param" {
  name  = "/unity/unity-ds/api-gateway/integrations/collections-create-dapa-function-name"
  type  = "String"
  value = aws_lambda_function.cumulus_collections_creation_dapa_facade.function_name
}

resource "aws_ssm_parameter" "cumulus_collections_ingest_dapa_ssm_param" {
  name  = "/unity/unity-ds/api-gateway/integrations/collections-ingest-dapa-function-name"
  type  = "String"
  value = aws_lambda_function.cumulus_collections_ingest_cnm_dapa.function_name
}

resource "aws_ssm_parameter" "cumulus_granules_dapa_ssm_param" {
  name  = "/unity/unity-ds/api-gateway/integrations/granules-dapa-function-name"
  type  = "String"
  value = aws_lambda_function.cumulus_granules_dapa.function_name
}
wphyojpl commented 1 year ago

The new lambda param for fastapi has a prefix which allows multiple deployment. The old parameters are being removed in PR #204