#geodesic - September 2019

September 2019
S
SweetOps #geodesicabout 7 years ago
There are no events this week
C
Cloud Posseabout 7 years ago
:zoom: Join us for "Office Hours" every Wednesday 11:30AM (PST, GMT-7) via Zoom.

This is an opportunity to ask us questions about INLINECODE_0, get live demos and learn from others using it. Next one is Sep 11, 2019 11:30AM.

👉️ Register for Webinar

:slack: #office-hours (our channel)
S
SweetOps #geodesicabout 7 years ago
There are no events this week
C
Cloud Posseabout 7 years ago
:zoom: Join us for "Office Hours" every Wednesday 11:30AM (PST, GMT-7) via Zoom.

This is an opportunity to ask us questions about INLINECODE_0, get live demos and learn from others using it. Next one is Sep 18, 2019 11:30AM.

👉️ Register for Webinar

:slack: #office-hours (our channel)
S
SweetOps #geodesicabout 7 years ago
There are no events this week
C
Cloud Posseabout 7 years ago
:zoom: Join us for "Office Hours" every Wednesday 11:30AM (PST, GMT-7) via Zoom.

This is an opportunity to ask us questions about INLINECODE_0, get live demos and learn from others using it. Next one is Sep 25, 2019 11:30AM.

👉️ Register for Webinar

:slack: #office-hours (our channel)
dalekurt
dalekurtabout 7 years ago
Hey guys, I’m using the reference architecture to setup my AWS landing zone and having an issue with make finalize with the following output - https://gist.github.com/dalekurt/7c451ba3914f066bf16b42392904aca1
dalekurt
dalekurtabout 7 years ago
I believe from the output some s3 bucket are missing from other accounts.
S
SweetOps #geodesicabout 7 years ago
There are no events this week
C
Cloud Posseabout 7 years ago
:zoom: Join us for "Office Hours" every Wednesday 11:30AM (PST, GMT-7) via Zoom.

This is an opportunity to ask us questions about INLINECODE_0, get live demos and learn from others using it. Next one is Oct 02, 2019 11:30AM.

👉️ Register for Webinar

:slack: #office-hours (our channel)
oscar
oscarabout 7 years ago
I’ve placed a file in /rootfs/usr/bin with the hopes it’ll copy to bin but no luck on make build. Any guidance available please?
joshmyers
joshmyersabout 7 years ago(edited)
did you make install your new container? Sure you are running the newly built version?
joshmyers
joshmyersabout 7 years ago(edited)
Putting into rootfs/usr/local/bin/foo worked for me with a make all
oscar
oscarabout 7 years ago
This is an existing geodesic module.
I have a new script : rootfs/usr/bin/lint and run make build and then start my Geodesic module, but the script is not in the /usr/bin/ dir in the Geodesic module container
oscar
oscarabout 7 years ago
Doesn’t seem any different to my rootfs/etc/profile.d/aliases.sh script, yet doesn’t copy over
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
In your Dockerfile, you'll need something like COPY rootfs/ /
oscar
oscarabout 7 years ago
COPY rootfs/ / Already present
oscar
oscarabout 7 years ago
oscar
oscarabout 7 years ago
so alises.sh works just fine
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
I suspect it's attaching to a running container
oscar
oscarabout 7 years ago
but lint does not
oscar
oscarabout 7 years ago
ah ok
oscar
oscarabout 7 years ago
Ah yes
oscar
oscarabout 7 years ago
I did have it open in a nother window
oscar
oscarabout 7 years ago
lets see
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
😃
oscar
oscarabout 7 years ago
Spot on 😉
oscar
oscarabout 7 years ago(edited)
Anyway to give a /usr/bin/ file chmod +x easily?
oscar
oscarabout 7 years ago
oscar
oscarabout 7 years ago
For now I’ve popped

COPY rootfs/ /
RUN chmod -R +x /usr/bin/
oscar
oscarabout 7 years ago
in Dockerfile which will do, but let me know if there’s a better solution
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
Hrmmm modes should be carried over from what is in git
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
According to that link, it’s an executable
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
Would need to take a deeper look
joshmyers
joshmyersabout 7 years ago
lol.
dalekurt
dalekurtabout 7 years ago
@Erik Osterman (Cloud Posse) That is correct, the mode of the file (in git) would be the same when copied to the Docker image.
oscar
oscarabout 7 years ago
Excellent thanks
oscar
oscarabout 7 years ago
Missed that part.
oscar
oscarabout 7 years ago
:doh:
oscar
oscarabout 7 years ago
We have some people using AWS Vault and other AWS auth mechanics. We’ve disabled aws-vault in the Dockerfile due to the UI prompts it causes that aren’t needed for ‘other auth’ users (90% of users).
For the 10% using AWS Vault, how can we have them use the same Geodesic/Dockerfile, but toggle AWS_VAULT_ENABLED ? I notice if you set this to true inside the container nothing happens, so it is clearly a build arg (could be wrong).

Any alts?
oscar
oscarabout 7 years ago
(Or is it possible to have it enabled but disable -> Run 'assume-role' to login to AWS with aws-vault that is printed on every command 😧 )
joshmyers
joshmyersabout 7 years ago
@oscar Have you looked through the geodesic codebase for how to do this? It is all pretty readable. I’m sure PRs welcome if it doesn’t do what you require
oscar
oscarabout 7 years ago
I have not. I will take a look and see if I can put a PR through
oscar
oscarabout 7 years ago
Thx
oscar
oscarabout 7 years ago
I imagine that runs at build time only?
oscar
oscarabout 7 years ago
Or rather container start
joshmyers
joshmyersabout 7 years ago
So, off the top of my head you could use build args here, which geodesic and build harness already supports
joshmyers
joshmyersabout 7 years ago
So you could an an ARG to the dockerfile, and change https://github.com/cloudposse/geodesic/blob/master/Makefile#L20 to make --no-print-directory docker:build ARGS="AWS_VAULT_ENABLED"
oscar
oscarabout 7 years ago
I’m actually leaning towards…
oscar
oscarabout 7 years ago

	PROMPT_HOOKS+=("aws_vault_prompt")
	function aws_vault_prompt() {
		if [ -z "${AWS_VAULT}" ] && [ "${AWS_VAULT_PROMPT" == "true"]; then
			echo -e "-> Run '$(green assume-role)' to login to AWS with aws-vaultdsfdsfdssf"
		fi
	}
oscar
oscarabout 7 years ago
👀
joshmyers
joshmyersabout 7 years ago
and add some makefile default that users can set an env var to turn off at build time
oscar
oscarabout 7 years ago
Would you accept the above?
joshmyers
joshmyersabout 7 years ago
It’s not me 🙂
oscar
oscarabout 7 years ago
Jeremy and Erik??
joshmyers
joshmyersabout 7 years ago
Not sure who atm but best open a PR and see
joshmyers
joshmyersabout 7 years ago
The above just turns off the prompt though, why not use the ENV var that is already there to turn the whole lot off, which is actually what you want
joshmyers
joshmyersabout 7 years ago
Not just the prompt.
oscar
oscarabout 7 years ago
I want AWS VAULT on, but prompt off
oscar
oscarabout 7 years ago
that way everyone can use the same Dockerfile no extra config
joshmyers
joshmyersabout 7 years ago
oscar
oscarabout 7 years ago
L142

	PROMPT_HOOKS+=("aws_vault_prompt")
	function aws_vault_prompt() {
		if [[ -z "${AWS_VAULT}" ]] && [[ "${AWS_VAULT_PROMPT" != "false"]]; then
			echo -e "-> Run '$(green assume-role)' to login to AWS with aws-vault"
		fi
	}
joshmyers
joshmyersabout 7 years ago
The above would also allow the same Dockerfile etc to be used
oscar
oscarabout 7 years ago
Yeh think I had some development time between then and went out for a lunch
oscar
oscarabout 7 years ago
That snippet wouldn’t affect anyone else
joshmyers
joshmyersabout 7 years ago
but the folks who do want to use aws-vault just set some var in their bash profile or whatever which will be used when they make build
oscar
oscarabout 7 years ago
but would allow others to disable prompt
joshmyers
joshmyersabout 7 years ago
What you want to do is already supported with some tweaks to the dockerfile/Makefile, which wouldn’t need to effect all of you.
joshmyers
joshmyersabout 7 years ago
Open a PR and I’m sure someone will get to it.
joshmyers
joshmyersabout 7 years ago
@oscar How will you set AWS_VAULT_PROMPT ?
oscar
oscarabout 7 years ago
Geodesic Dockerfile
joshmyers
joshmyersabout 7 years ago
Right, so you still need to add something to the Dockerfile
oscar
oscarabout 7 years ago
Yep, I am ok with that, is that a problem generally?
oscar
oscarabout 7 years ago
Seems like an OK thing. It’s a per geodesic module config
joshmyers
joshmyersabout 7 years ago(edited)
No but I don’t see how it differs from the suggestion above which doesn’t involve a PR as it is already supported. Also still not sure why you want AWS_VAULT_ENABLED true, but no prompt….
oscar
oscarabout 7 years ago
Other people can benefit 🤷‍♂️
oscar
oscarabout 7 years ago
Ok I can explain
oscar
oscarabout 7 years ago
Maybe context will help understand my rationale
joshmyers
joshmyersabout 7 years ago
Maybe best off to add that to the PR.
oscar
oscarabout 7 years ago
We have 9 users on Azure AD authing with AWS
oscar
oscarabout 7 years ago
we have to use this NPM package called aws-azure-login
oscar
oscarabout 7 years ago
we don’t need aws-vault
oscar
oscarabout 7 years ago
but we have 1 user using IAM users with keypair
oscar
oscarabout 7 years ago
they need aws-vault
oscar
oscarabout 7 years ago
We all use the same geodesic repo + module + files
oscar
oscarabout 7 years ago
I understand the geodesic local config
oscar
oscarabout 7 years ago
that is fine in principle
oscar
oscarabout 7 years ago
but I don’t want to have to ask people to do such things
joshmyers
joshmyersabout 7 years ago
So how can all users use the same dockerfile now if passing AWS_VAULT_PROMPT = false ?
oscar
oscarabout 7 years ago
Because we don’t use aws-vault, but now the prompt is gone
oscar
oscarabout 7 years ago
So it’s there
oscar
oscarabout 7 years ago
just not in our faces
joshmyers
joshmyersabout 7 years ago
sigh
joshmyers
joshmyersabout 7 years ago
nvm
oscar
oscarabout 7 years ago
Plus even when using aws-vault it’s annoying
oscar
oscarabout 7 years ago
You don’t need the prompt to use vault
oscar
oscarabout 7 years ago
or am I misunderstanding
joshmyers
joshmyersabout 7 years ago
You don’t need the prompt no.
oscar
oscarabout 7 years ago
I am missing why you are frustrated then
oscar
oscarabout 7 years ago
Your solution is good. Have a .bashrc variable and pass it in the build target, but I don’t want to have to ask people to modify their .bashrc
joshmyers
joshmyersabout 7 years ago
From experience working with devs who may not be used to AWS or geodesic, telling them to assume-role is useful. Rather than not, expecting people to know to run the thing before anything else
joshmyers
joshmyersabout 7 years ago
and what you actually want to do is not enable AWS_VAULT for those users, not just hide the prompt for all…
joshmyers
joshmyersabout 7 years ago
anyway, nvm, I see your use case.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
public #office-hours starting now! join us to talk shop https://zoom.us/j/508587304
Fred Light
Fred Lightabout 7 years ago
hi guys ! tnaks for the SweetWorks ! I don't really understand how you can override the policy or roles attributes using terraform-aws-ecr (0.6.1 tag) module. The documentation seems a bit outdated because the provided samples raise error in geodesic shell. Do you have an up to date usage sample ?
oscar
oscarabout 7 years ago
You would want to extend it (fork and PR) so that it can default to a policy doc that has CP’s default but also support taking from a users input https://github.com/cloudposse/terraform-aws-ecr/blob/master/main.tf#L28
Fred Light
Fred Lightabout 7 years ago
thxs @oscar
oscar
oscarabout 7 years ago
(but as of yet doesn’t look like you can hence why you’d need to develop it yourself)
Fred Light
Fred Lightabout 7 years ago
ok got it clear. i was wondering this because of the error but in the meantime i understood it was linked to the IAM role not being specified as data. So no need to PR at the end but good to know it work this way.
oscar
oscarabout 7 years ago
What’s the error?
oscar
oscarabout 7 years ago
FYI
oscar
oscarabout 7 years ago
0.6.1 is TF 11
oscar
oscarabout 7 years ago
0.7.0 is TF 12
oscar
oscarabout 7 years ago
So you want TF 11? Okie that’s fine. Is your Geodesic using TF 11?
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 7 years ago
@Fred Light here is the latest example on using aws-ecr module https://github.com/cloudposse/terraform-root-modules/blob/master/aws/ecr/kops_ecr_app.tf#L11
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 7 years ago
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)about 7 years ago
thanks @oscar !
S
SweetOps #geodesicabout 7 years ago
There are no events this week
C
Cloud Posseabout 7 years ago
:zoom: Join us for "Office Hours" every Wednesday 11:30AM (PST, GMT-7) via Zoom.

This is an opportunity to ask us questions about INLINECODE_0, get live demos and learn from others using it. Next one is Oct 09, 2019 11:30AM.

👉️ Register for Webinar

:slack: #office-hours (our channel)