udacity / nd9991-c3-hello-world-exercise-solution Goto Github PK
View Code? Open in Web Editor NEWHello world exercise from ND9991 C3 L4
Hello world exercise from ND9991 C3 L4
in main4.yml
after creating infrastructure ec2, need to use ansible to do some config tasks in this EC2.
how to auto get EC2's public IP?
Now it seems to need to manually get and edit the main4.yml file?
any other solution?
hosts: 44.192.7.133
The create_and_deploy_front_end job is failing in CircleCI:
Waiting for changeset to be created..
Waiting for stack create/update to complete
Failed to create/update the stack. Run the following command
to fetch the list of events leading up to the failure
aws cloudformation describe-stack-events --stack-name stack-create-bucket-4107f96
Exited with code exit status 255
When I run the describe-stack-events
command, I see the following error:
CREATE_FAILED Bucket cannot have ACLs set with ObjectOwnership's BucketOwnerEnforced setting (Service: Amazon S3; Status Code: 400; Error Code: InvalidBucketAclWithObjectOwnership; Request ID: PH3A3FN20TS9H7CA; S3 Extended Request ID: 3tsO51e7/ugunMvoeh/acWVGKAb+5hbumfFd+CPqfHSsYlT/bDHbSGOnePEySYVGWm1/hexc88o=; Proxy: null)
This appears to be due to a recent change to default settings on newly created buckets. Following some hints from that Stack Overflow I was able resolve the problem by removing the PublicRead ACL and replacing with public access config and ownership controls:
diff --git a/bucket.yml b/bucket.yml
index c179569..7b43bb0 100644
--- a/bucket.yml
+++ b/bucket.yml
@@ -9,7 +9,14 @@ Resources:
Type: AWS::S3::Bucket
Properties:
BucketName: !Sub "${MyBucketName}"
- AccessControl: PublicRead
+ PublicAccessBlockConfiguration:
+ BlockPublicAcls: false
+ BlockPublicPolicy: false
+ IgnorePublicAcls: false
+ RestrictPublicBuckets: false
+ OwnershipControls:
+ Rules:
+ - ObjectOwnership: ObjectWriter
WebsiteConfiguration:
IndexDocument: index.html
ErrorDocument: error.html
i'm setting up a web server in an EC2 using ci / cd circleci.
but get always get error
ansible-playbook -i inventory.txt main-remote.yml
Error from CircleCi
PLAY [Exercise for setting up a web server in an EC using ci / cd circleci] ****
TASK [Gathering Facts] *********************************************************
fatal: [54.196.240.122]: UNREACHABLE! => {"changed": false, "msg": "unpack requires a buffer of 4 bytes", "unreachable": true}
PLAY RECAP *********************************************************************
54.196.240.122 : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
Exited with code exit status 4
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.