This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-11
Channels
- # announcements (16)
- # aws (17)
- # babashka (25)
- # beginners (60)
- # calva (40)
- # cider (3)
- # clara (4)
- # clj-kondo (24)
- # clojure (16)
- # clojure-austin (3)
- # clojure-dev (23)
- # clojure-europe (33)
- # clojure-nl (2)
- # clojure-norway (7)
- # clojure-uk (4)
- # clojurescript (39)
- # clr (108)
- # conjure (10)
- # cursive (12)
- # datalevin (7)
- # editors (2)
- # events (1)
- # fulcro (24)
- # graalvm (3)
- # introduce-yourself (8)
- # london-clojurians (2)
- # malli (18)
- # meander (6)
- # missionary (10)
- # nbb (16)
- # off-topic (19)
- # polylith (1)
- # portal (4)
- # rdf (1)
- # reitit (4)
- # remote-jobs (3)
- # shadow-cljs (10)
- # xtdb (12)
Hi,
I am using the cognitect-labs/aws-api to deploy my resources on my AWS account.
However, I have issue with the :Tags
. The resource is created but without the tags.
(aws/invoke ec2-client {:op :CreateVpc
:request {:CidrBlock "192.168.0.0/16"
:Tags [{:Key "Name" :Value "my-vpc"}]}})
I tried with CreateSubnet, CreateInternetGateway etc, still the same result.
Am I missing something?According to the docs the CreateVPC API operation doesn't have a "Tags" option. You can check it in the docs site: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVpc.html It has something called "TagSpecification" which maybe is what you need? (never used it myself)
You can also run (aws/doc ec2-client :CreateVpc)
to see the exact Clojure data structure that the aws-api client expects
The aws/doc
or aws/op
both show a Tags
param:
{:Vpc
{:Tags [:seq-of {:Key string, :Value string}],
:IsDefault boolean,
:InstanceTenancy [:one-of ["default" "dedicated" "host"]],
:CidrBlock string,
...
:VpcId string}}
And when I :DescribeVpcs with Name
tag I manually added via the Console, they do show in a :Tags
param with same syntax as I tried above.
The aws/doc
command shows both the Request and the Response. I can only see Tags
in the Response section.
Oh got it:
(aws/invoke ec2-client {:op :CreateVpc
:request {:CidrBlock "192.168.0.0/16"
:TagSpecifications [{:ResourceType "vpc"
:Tags [{:Key "Name" :Value "my-vpc"}]}]}})
You were right, TagSpecification
is what I needed. I just had to add the mandatory ResourceType
Thank youIs there already a way to easily convert a dynamoDB response map with types to one without?
Which API are you using? There should be methods to marshall and unmarshall dynamodb JSON
https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/modules/_aws_sdk_util_dynamodb.html
or if you use interop with JS or Java
Hmm this doesn’t look too hard: https://github.com/aws/aws-sdk-js-v3/blob/6d48f1be73d63eeddef4cf10f1b05d313f9e1495/packages/util-dynamodb/src/convertToNative.ts#L12
@UBTMXD33J I'm not sure what you're after here. What response are you getting and what do you want it to be?
I was looking if something like this https://github.com/ctorrisi/franklin/blob/master/src/franklin/core.clj#L56-L72 was already available