Reputation: 367
I use the ex_aws
dependency in my elixir/phoenix project to make some actions in my aws account. Now I need to run something like this to invalidate the cache:
aws cloudfront create-invalidation --distribution-id 1111111111 --paths '/*'
But the ex_aws
dependency doesn't have the cloudfront service. Any solutions for this?
Versions:
{:phoenix, "~> 1.4.0"}
...
{:ex_aws, "~> 2.1.0"},
{:ex_aws_s3, "~> 2.0.1"},
Upvotes: 4
Views: 279
Reputation: 121010
You should not try to cover all the functionality AWS provides via pure Elixir wrappers. Erlang (and hence Elixir) both are built to maintain a very good interaction level with the underlying OS and System.cmd/3
is the first class citizen. So,
System.cmd(
"aws",
~w|cloudfront create-invalidation --distribution-id 1111111111 --paths '/*'|,
env: [{"MIX_ENV", "prod"}])
Upvotes: 3