#aws - February 2019

152 messages

:aws: Discussion related to Amazon Web Services (AWS)
Archive: https://archive.sweetops.com/aws/

February 2019
i5okie
i5okiealmost 8 years ago
in ECS, with autodiscovery ALB.. is it possible to set the subdomain name to be different from the service name?
i5okie
i5okieover 7 years ago
I’ve been trying to figure out how to ‘architect’ the stack for our apps. we have 4 different services. This is a Ruby on Rails stack.
- 1. the main app, public dns,
- 2. auth, public dns.
- 3 background scheduler - private dns needs to be accessible from main app.
- 4. another app with private dns to be accessible by main app.

Fargate, RDS, elasticache.
--
I guess i need two ALBs. one private, and one public.

— questions —
Is there any advantage/benefit to throwing Traefik in there somewhere?
- if so, what would the stack look like (a secondary ecs cluster just for traefik? or stick traefik in the same cluster as the apps?)

Is there a tutorial / guide on how to use SSM Parameter Store to get ENVVARS into each task/container on deploy?
joshmyers
joshmyersover 7 years ago
@i5okie this sounds like a pretty contained app, I’m not sure what Traefik would add to it being more of an edge proxy
i5okie
i5okieover 7 years ago
so just the dual ALB public and private?
joshmyers
joshmyersover 7 years ago
Is auth an internal app in the above?
i5okie
i5okieover 7 years ago
yeah just a microservice type thing
joshmyers
joshmyersover 7 years ago
yeah make that an internal alb
i5okie
i5okieover 7 years ago
thank you
chrism
chrismover 7 years ago
Anyone using 99designs/aws-vault with packer? set the variables to use the aws env vars

    "aws_access_key": "{{env `AWS_ACCESS_KEY_ID`}}",
    "aws_secret_key": "{{env `AWS_SECRET_ACCESS_KEY`}}",

but aws just spits it back out Build 'amazon-ebs' errored: error validating regions: AuthFailure: AWS was not able to validate the provided access credentials 99 aws-vault

Works fine with terraform though 🤔
chrism
chrismover 7 years ago
more confused after poking through other peoples shit in github as they're using the same thing.
Straindevops
Straindevopsover 7 years ago
We are looking for implementing transit vpc. Most third party solutions (Cisco, Aviatrix etc.) are expensive. Has anyone used AWS transit gateway? If yes, how was the experience?
Straindevops
Straindevopsover 7 years ago
Steven
Stevenover 7 years ago
We decided not to use because of the increased cost over using VPC peering
Straindevops
Straindevopsover 7 years ago
I see
Straindevops
Straindevopsover 7 years ago
In our case there are multiple vpc and giving vpn access to Transit VPC makes more sense
Straindevops
Straindevopsover 7 years ago
So evaluating this option
Steven
Stevenover 7 years ago
It simplifies things but at additional cost for all traffic. So depends use case, If only for user VPN, it could make sense. But we needed that as well as apps going cross accounts for shared resources
Steven
Stevenover 7 years ago
Thanks
Pablo Costa
Pablo Costaover 7 years ago(edited)
Hello, I'm looking to vpc sharing as a way to reduce VPN costs, but I already implemented a vpc transit solution using FRR with BGP and Strongswan (IPsec) https://frrouting.org/
Igor
Igorover 7 years ago
How does VPC Sharing fit in with the practice of having separate AWS accounts for each environment? As an example, would it be a bad idea to share a VPC between Staging and Production?
Straindevops
Straindevopsover 7 years ago
@Igor VPC sharing is not meant to be cross environment. The idea is to a) centralize management/billing from one account 2) make account boundaries transparent per environment. So for example if dev environment has components spread across multiple AWS accounts then all those components can be part of a single VPC (which earlier required separate VPC)
Straindevops
Straindevopsover 7 years ago
@Pablo Costa I am curious how are you creating/updating transit vpc. Does Strongswan give any tools to do it or you are manually (from aws console or terraform) creating all required routing?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
This looks pretty cool
erik
erikover 7 years ago
Maciek Strömich
Maciek Strömichover 7 years ago
Hey, did anyone upgrade dc1 to dc2 redshift clusters using Cloudformation? I know there are 2 paths using snapshot-restore and elastic resizing but I don’t want to cause a drift from CF state doing it manually and I wonder if CF does handle the upgrade in a data-loss-less way
Maciek Strömich
Maciek Strömichover 7 years ago
FYI if anyone is interested upon dc1 to dc2 redshift upgrade via cloudformation data is being migrated. the only thing to remember is that during the migration cluster is available only in read only mode
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Nikola Velkovski
Nikola Velkovskiover 7 years ago(edited)
Morning People, anyone can help me with how ECS decides to place the tasks when multiple ordered_placement_strategy blocks are used?
Given the following example:
I've 4 tasks ( dockers ) and 2 machines in 2 different AZs


ordered_placement_strategy {
    type  = "spread"
    field = "attribute:ecs.availability-zone"
  }

  ordered_placement_strategy {
    field = "memory"
    type  = "binpack"
  }

Will ECS stop bringing tasks up because it won't be able to do so because the first placement block says different AZ or something entirely different will happen?
Anyone got any ideas ?
Abel Luck
Abel Luckover 7 years ago(edited)
The cloudfront docs on which types of certs are valid is very confusing
It seems you can use an ECC cert between cloudfront <---> origin
but only an RSA cert between viewer <---> cloudfront
but i can't find this explicitly stated anywhere
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
hrm…. not something we’ve run in to
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
(that said, we have some modules for cloudfront and acm)
Maciek Strömich
Maciek Strömichover 7 years ago
do you observe RDS hostname resolution issues in us-east-1?
chrism
chrismover 7 years ago
When you waste time writing code around aws config ... then look at the pricing. 😬
joshmyers
joshmyersover 7 years ago
@chrism Wrote https://github.com/alphagov/pay-aws-compliance a while back to help with auditing of AWS resources (and some others) - run as a scheduled Lambda - cheap!
chrism
chrismover 7 years ago
chrism
chrismover 7 years ago
which is pretty nice
chrism
chrismover 7 years ago
I'll add the alpha gov one to my list 😄
joshmyers
joshmyersover 7 years ago
Prowler looks pretty full featured, but bash! 😮
chrism
chrismover 7 years ago
Well we run it via teamcity within docker and output the report as an artifact 😛
chrism
chrismover 7 years ago
plops it in a report tab; though I need to look at the background colour of the html at some point.
joshmyers
joshmyersover 7 years ago
Nice
joshmyers
joshmyersover 7 years ago
Can hook up Lambdas to SNS to send email reports etc too
chrism
chrismover 7 years ago
cuts down on the drudgery
chrism
chrismover 7 years ago
It's a nice tool 😄
joshmyers
joshmyersover 7 years ago
Looks good 👌
chrism
chrismover 7 years ago
Drowning in things analysing aws; though Im yet to get anything of value from GuardDuty beyond 3rd parties appreciating it as a tick box 🙄
joshmyers
joshmyersover 7 years ago
Never looked at GuardDuty
joshmyers
joshmyersover 7 years ago
It’s impossible to keep up with all the AWS services hah
chrism
chrismover 7 years ago
they certainly dont miss a trick; just wish they'd have a chat with other areas of aws before building them 😛
chrism
chrismover 7 years ago
annoying levels of disconnect between products; you set your multi region cloudtrail... and they bring out guard duty that has to be enabled in each regions. Oh and you can hook it up to another account so you can read from your root account the guard duty events of prod/testing etc.... but you have to do it per region, per account via invites 😬
chrism
chrismover 7 years ago
... one of those moments you terraform the creation and realise you're going to have to go hand-ball all the invite acceptance
chrism
chrismover 7 years ago
They almost got it right, but then didnt 😄
chrism
chrismover 7 years ago
Pretty cheap though compared to most aws things so it has that going for it
chrism
chrismover 7 years ago
chrism
chrismover 7 years ago
meh think i'll just configure the hell out of existing scanners. AWS configs one of those things that looks like it'll drive me up the f'ing wall rather than save me time 🤣
chrism
chrismover 7 years ago
I was looking at https://github.com/cloudposse/terraform-aws-cloudwatch-flow-logs but it doesnt seem to fit with the ref-architecture way of splitting audit off / storing to s3. its just flowlog>kinesis>CW
chrism
chrismover 7 years ago
its kinda either or; I may be overthinking this
joshmyers
joshmyersover 7 years ago
Not sure on that one tbh, but have you looked at flowlogs or thought about what you wanna do with them?
joshmyers
joshmyersover 7 years ago
Have used mainly as a checkbox exercise before
joshmyers
joshmyersover 7 years ago
Creating/managing alerts/dashboards with them is quite expensive in terms of mgmt cost
chrism
chrismover 7 years ago
Yeah tbh the idea seems utterly pointless for the most point
chrism
chrismover 7 years ago
tickboxes for everyone
chrism
chrismover 7 years ago
Lets put it this way, if you're having to dig into tb's of flow logs to find evidence of something; you've missed a bigger step elsewhere 😄
joshmyers
joshmyersover 7 years ago
How else are you going to find out how much data was exfiltrated from your environment for realz?!
giphy
giphyover 7 years ago
chrism
chrismover 7 years ago
nothing like a terraform-github safari to find how other people dealt with stuff, and realising you've been here before
joshmyers
joshmyersover 7 years ago
lol
chrism
chrismover 7 years ago
reaches for the star
already starred
joshmyers
joshmyersover 7 years ago
seriously though, storing flowlogs in something like $LOGGING_SAAAS_PROVIDER generates so much data, is not cheap to do anything proactive with the data
joshmyers
joshmyersover 7 years ago
cloudwatch would be cheaper but limited
chrism
chrismover 7 years ago
More worrying is when our SIEM tool hooks on, and reprocesses the same data 😐️
chrism
chrismover 7 years ago
You know your siem monitoring is worth the cash when you terraform up 30 machines in vsphere; tear them all down and they alert you a day later 🤣
chrism
chrismover 7 years ago
Well worth the email notification at 7am on a saturday
chrism
chrismover 7 years ago
GuardDuty will also look for compromised EC2 instances talking to malicious entities or services, data exfiltration attempts, and instances that are mining cryptocurrency.
chrism
chrismover 7 years ago
well at least guard duty covers the ex-filtration side; though id be interested to know how that works if its someones shitty app code being abused to haul data out
chrism
chrismover 7 years ago
my feeling is it wouldnt notice
joshmyers
joshmyersover 7 years ago
Bet it won't pick up exfiltrating to an attacker owned S3 bucket
chrism
chrismover 7 years ago
"its in aws, everything is awesome"
chrism
chrismover 7 years ago
best place to pull data to; aws would take an age to lock you out and the transfers that fast you've less chance of the owner locking you out before you get it
joshmyers
joshmyersover 7 years ago
Need to watch out for that too if using S3 endpoints and aren't locking down your buckets it bypasses any egress proxies you may have in place
joshmyers
joshmyersover 7 years ago
Found that out during a pentest :D
chrism
chrismover 7 years ago
we only really have public stuff in buckets; outside of the whole snowplow usage and thats all anonomised noise
chrism
chrismover 7 years ago
keeping data in SAAS, aka flick switch for encryption, flick switch for firewall, flick switch for logs 😄
chrism
chrismover 7 years ago
after years of terraform its nice at times to be able to keep shit pretty secure and not have to spend days tweaking bollocks to get there 😛
chrism
chrismover 7 years ago
pretty secure, as nothing is totally secure
chrism
chrismover 7 years ago
I need to look at s3 bucket security again as they love to change things
chrism
chrismover 7 years ago
The UI change was nice, more explicit options to not allow buckets to become public by accident
chrism
chrismover 7 years ago
Don't wholly understand why they're terrified of making it default-on
chrism
chrismover 7 years ago
the IAM stuff around S3 is pretty powerful; ridiculously so compared to Azures
joshmyers
joshmyersover 7 years ago
yeah but too many folks left things open which leads to breaches
chrism
chrismover 7 years ago
I mean why they don't default it to most secure and make people open it up. They've made the UI better but it wont stop people doing dumb shit
chrism
chrismover 7 years ago
I mean I know it wont
I'm still sat skimming tls updates for bucket names
joshmyers
joshmyersover 7 years ago
ah, hadn’t spent too much time poking in the UI recently
chrism
chrismover 7 years ago
our original account is old as f'; so where no terraform lives, one has to spelunk in aws ui.
chrism
chrismover 7 years ago
Compared to azure portal though everythings a dream
joshmyers
joshmyersover 7 years ago
hah, so I’ve heard
chrism
chrismover 7 years ago
I imagine its where the Windows 8 UI creator ended up as punishment
chrism
chrismover 7 years ago
terraform and azure sounded like a dream come true
then I used it in anger for a month
lots of anger
lots and lots
chrism
chrismover 7 years ago
3 machine cluster
22minutes... still not complete
TIMES THE HELL OUT
chrism
chrismover 7 years ago
wasn't very impressive 😄
Igor
Igorover 7 years ago
I have been getting a lot of We currently do not have sufficient {instance-type} capacity in the Availability Zone you requested {zone}. messages in EC2. Is this common? Does AWS address these capacity issues?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
this is where RIs help 😃
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
...as they provide capacity reservations
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
@Igor can't say we've been seeing it lately, but it highly depends on (a) the region you're operating in (b) the type of instance
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago(edited)
for example, we've seen this in the past when AWS has had a regional zone failure in a region and everyone auto scales out to the other zones
Igor
Igorover 7 years ago
So I need to purchase RIs for the specific AZ?
Igor
Igorover 7 years ago
At least that's something 🙂
Igor
Igorover 7 years ago
@Erik Osterman (Cloud Posse) Do you know if there is a way to attach the RIs to an ASG? I purchased a couple, but they seem to immediately be used up on existing running instances.. which makes sense in retrospect
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
RIs are not a directly addressable resource from the EC2 perspective
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
it's a billing instrument
Igor
Igorover 7 years ago
Yeah, but when it comes to capacity
Igor
Igorover 7 years ago
I want PROD instances to take priority over non-PROD, if that makes sense
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago(edited)
but they are not running in the same account, right? so that won't happen 😏
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
i am not sure how to prioritize RI capacity reservations within an account
Igor
Igorover 7 years ago
It's a legacy pre-SweetOps account 😉
Igor
Igorover 7 years ago
I am locked for some customers due to not being able to move around NAT elastic IPs, and whitelisting changes are a pain
Igor
Igorover 7 years ago
#HarshRealityOps ?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
yea, there are in the end always some things outside of our control
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
the NAT IP thing comes up regularly
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
has anyone seen something to enforce arbitrary limits on the number of specific kinds of resources which match a given tag?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
basically a policy enforcement engine for aws which would let us say untagged instances are automatically destroyed
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
if the count of instances with tag Developer=foobar, is greater than X, then alert
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago(edited)
if the count of instances with tag Developer=baz is greater than Y, then kill until less than Z
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
chrism
chrismover 7 years ago
If you setup WSL via the store (as they say you should now) geodesic fails to map the path 😬 🔫
It assumes its still in the local/lxss when in reality its in AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc
chrism
chrismover 7 years ago
Guess this needs to be smarter 😄
chrism
chrismover 7 years ago
joys of changing
chrism
chrismover 7 years ago
infact
chrism
chrismover 7 years ago
simpler
chrism
chrismover 7 years ago
the if/else just needs reversing; check for canonical ... but i imagine that might have unexpected consiquences
chrism
chrismover 7 years ago
or msft need to stop being random af
chrism
chrismover 7 years ago
😄
chrism
chrismover 7 years ago
I'm taking the lazy way out and just blowing the folder away seeing ms' command for removing lxss full didn't actually do what anyone of reasonably sound mind would call "FULLY remove"
chrism
chrismover 7 years ago
kinda stuff that makes you think ubuntu desktop maybe the future; then you remember how much that blows 😄
chrism
chrismover 7 years ago
AWS v2 providers out
chrism
chrismover 7 years ago(edited)
aka as good a time as any to add that version = "1.60.0" to your provider 🤣
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
@chrism any chance we could get your help improving that path extrapolation? I'd be happy to jump on a call
chrism
chrismover 7 years ago
Think it might be worth a ticket on WSL to add some sort of inbuilt var of winpath
chrism
chrismover 7 years ago
He asks, and the lord microsoft giveth
chrism
chrismover 7 years ago
already exists
chrism
chrismover 7 years ago
wslpath -wa . in WSL returns the windows path to the current folder
chrism
chrismover 7 years ago
Been around a while too
chrism
chrismover 7 years ago
I shall give that a stab
chrism
chrismover 7 years ago