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

Private Subnet Public Loadbalancer issue #15

Open
r8or0pz opened this issue Oct 1, 2019 · 3 comments
Open

Private Subnet Public Loadbalancer issue #15

r8or0pz opened this issue Oct 1, 2019 · 3 comments

Comments

@r8or0pz
Copy link

r8or0pz commented Oct 1, 2019

I got "No export named production:PublicListener found. Rollback requested by user." error.
Any ideas on how to fix it?

@dougtoppin
Copy link

dougtoppin commented Oct 2, 2019

@lngphp The issue may be that when you created the service stack you did not provide the StackName parameter which is the name of the cluster stack that you created first so it is defaulting to production. If that is not what you called the cluster stack the service stack creation may fail with that error.

I have a Makefile that I use to create the cluster and services. It is a bit easier to do it that way I found.

The following is what I have in it for the cluster and service.

I have not used this in a while and am out of time tonight but I will try it again tomorrow night.

StackName=test-fargate
StackNameService=${StackName}-service

CFTBASE=fargate-networking-stacks/public-vpc.yml
CFTSERVICE=service-stacks/public-subnet-public-loadbalancer.yml

create-cluster:
	aws cloudformation create-stack --stack-name ${StackName} \
		--template-body file://${CFTBASE} \
		--capabilities CAPABILITY_IAM

create-service:
	aws cloudformation create-stack \
		--stack-name ${StackNameService} \
		--template-body file://${CFTSERVICE} \
		--parameters ParameterKey=StackName,ParameterValue=${StackName} \
		--capabilities CAPABILITY_IAM

@dougtoppin
Copy link

dougtoppin commented Oct 3, 2019

If it is helpful, I did just confirm that the following Makefile can create and delete the public-vpc and public-subnet-public-loadbalancer configuration of this Fargate example.

The running nginx url can be found from the cluster stack ExternalUrl output.

The usage of this would look like the following which will create everything and then output the url to the service.

make create-cluster create-service get-url

Makefile contents

StackName=test-fargate
StackNameService=${StackName}-service

CFTBASE=fargate-networking-stacks/public-vpc.yml
CFTSERVICE=service-stacks/public-subnet-public-loadbalancer.yml

create-cluster:
        aws cloudformation create-stack --stack-name ${StackName} \
                --template-body file://${CFTBASE} \
                --capabilities CAPABILITY_IAM
        aws cloudformation wait stack-create-complete --stack-name  ${StackName}

create-service:
        aws cloudformation create-stack \
                --stack-name ${StackNameService} \
                --template-body file://${CFTSERVICE} \
                --parameters ParameterKey=StackName,ParameterValue=${StackName} \
                --capabilities CAPABILITY_IAM
        aws cloudformation wait stack-create-complete --stack-name ${StackNameService}

delete-cluster:
        aws cloudformation delete-stack --stack-name ${StackName}
        aws cloudformation wait stack-delete-complete --stack-name ${StackName}

delete-service:
        aws cloudformation delete-stack --stack-name ${StackNameService}
        aws cloudformation wait stack-delete-complete --stack-name ${StackNameService}

get-url:
        aws cloudformation describe-stacks --stack-name ${StackName} --query 'Stacks[].Outputs[?OutputKey==`ExternalUrl`].OutputValue' --output text

@r8or0pz
Copy link
Author

r8or0pz commented Oct 3, 2019

Thank you so much!

juancarlostong added a commit to juancarlostong/aws-cloudformation-fargate that referenced this issue Mar 4, 2020
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