Skip to content
This repository was archived by the owner on Jul 18, 2024. It is now read-only.
This repository was archived by the owner on Jul 18, 2024. It is now read-only.

bug: Unsupported type: cloudformation #202

@marcarvar

Description

@marcarvar

Hello,

Today, I wanted to reproduce this example on my AWS account following the repository guide. After fighting me a little with the installation of the dependencies, I have executed:

make all

In several parts of the execution output, the following error was shown:

Unsupported type: cloudformation

Usage: {PATH}/aws-serverless-ecommerce-platform/tools/lint TYPE SERVICE

This happens with all the Tools folder scripts.

Checking the scripts I see that the next code shows that output:

type tests_$TYPE | grep -q "function" &>/dev/null || {
    echo "Unsupported type: $TYPE"
    echo
    display_usage
    exit 1
}

The problem of this verification, to know if there is function, is the dependence of the language(locale) of the shell. In my case when having it in Spanish I have to change the "function" value for "función". Because in my case that command returns the following:

$ type check-deps_cloudformation
check-deps_cloudformation: es una función
check-deps_cloudformation () 
{ 
    dependencies=$(yq -r ' .dependencies[]? ' $service_dir/metadata.yaml);
    echo "$dependencies" | grep --color=auto -q \* && { 
        dependencies="$($ROOT/tools/services --exclude ${SERVICE})"
    };
    echo dependencies=$dependencies;
    for dependency in $dependencies;
    do
        stack_name=${DOMAIN:-ecommerce}-${ENVIRONMENT:-dev}-${dependency};
        aws cloudformation describe-stacks --stack-name $stack_name | jq -r ' .Stacks |
                map(
                    .StackStatus
                    | test("(CREATE_FAILED|ROLLBACK_IN_PROGRESS|ROLLBACK_COMPLETE|ROLLBACK_FAILED|DELETE_IN_PROGRESS|DELETE_COMPLETE|DELETE_FAILED)")
                    | not
                ) ' | grep --color=auto -q "true" && { 
            FOUND=true
        };
        if [ -z $FOUND ]; then
            echo "Stack $stack_name not found";
            stack_name=${DOMAIN:-ecommerce}-${dependency};
            aws cloudformation describe-stacks --stack-name $stack_name | jq -r ' .Stacks |
                    map(
                        .StackStatus
                        | test("(CREATE_FAILED|ROLLBACK_IN_PROGRESS|ROLLBACK_COMPLETE|ROLLBACK_FAILED|DELETE_IN_PROGRESS|DELETE_COMPLETE|DELETE_FAILED)")
                        | not
                    ) ' | grep --color=auto -q "true" && { 
                FOUND=true
            };
        fi;
        if [ -z $FOUND ]; then
            echo "Stack $stack_name not found";
            exit 1;
        fi;
    done
}

By making this change I have managed to advance in the deployment although I still have to solve some more mistake. I do not know if there is any alternative solution to make that check but at least there is a record of this error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions