Skip to content

Commit ed32954

Browse files
authored
Add ecs-parameters to AWS::Events::Rule (#200)
1 parent ba9d15b commit ed32954

File tree

4 files changed

+49
-2
lines changed

4 files changed

+49
-2
lines changed

src/crucible/aws/events.clj

+7-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,18 @@
33
(:require [crucible.resources :refer [spec-or-ref defresource] :as res]
44
[crucible.values :as v]
55
[crucible.encoding.keys :refer [->key]]
6+
[crucible.aws.events.ecs-parameters :as ecs-parameters]
67
[clojure.spec.alpha :as s]))
78

8-
(s/def ::id (spec-or-ref #(re-matches #"[\.\-_A-Za-z0-9]+" %)))
9+
(s/def ::id (spec-or-ref (s/and string? #(re-matches #"[\.\-_A-Za-z0-9]+" %))))
910

1011
(s/def ::arn (spec-or-ref string?))
1112

12-
(s/def ::target (s/keys :req [::arn ::id]))
13+
(s/def ::ecs-parameters ::ecs-parameters/ecs-parameters-spec)
14+
15+
(s/def ::target (s/keys :req [::arn
16+
::id]
17+
:opt [::ecs-parameters]))
1318

1419
(s/def ::targets (s/coll-of ::target :kind vector?))
1520

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
(ns crucible.aws.events.aws-vpc-configuration
2+
"AWS::ECS::Rule > AwsVpcConfiguration"
3+
(:require [clojure.spec.alpha :as s]
4+
[crucible.resources :refer [spec-or-ref]]))
5+
6+
(s/def ::assign-public-ip (spec-or-ref string?))
7+
8+
(s/def ::security-groups (s/coll-of string? :type vector))
9+
10+
(s/def ::subnets (s/coll-of string? :type vector))
11+
12+
(s/def ::aws-vpc-configuration-spec (s/keys :req [::subnets]
13+
:opt [::assign-public-ip
14+
::security-groups]))
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
(ns crucible.aws.events.ecs-parameters
2+
"AWS::ECS::Rule > EcsParameters"
3+
(:require [clojure.spec.alpha :as s]
4+
[crucible.aws.events.network-configuration :as network-configuration]
5+
[crucible.resources :refer [spec-or-ref]]))
6+
7+
(s/def ::group (spec-or-ref string?))
8+
(s/def ::launch-type (spec-or-ref string?))
9+
(s/def ::platform-version (spec-or-ref string?))
10+
(s/def ::task-count (spec-or-ref integer?))
11+
(s/def ::task-definition-arn (spec-or-ref string?))
12+
(s/def ::network-configuration ::network-configuration/network-configuration-spec)
13+
14+
(s/def ::ecs-parameters-spec (s/keys :req [::task-definition-arn]
15+
:opt [::group
16+
::launch-type
17+
::platform-version
18+
::task-count
19+
::network-configuration]))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
(ns crucible.aws.events.network-configuration
2+
"AWS::ECS::Rule > NetworkConfiguration"
3+
(:require [clojure.spec.alpha :as s]
4+
[crucible.aws.events.aws-vpc-configuration :as aws-vpc-configuration]
5+
[crucible.resources :refer [spec-or-ref]]))
6+
7+
(s/def ::aws-vpc-configuration ::aws-vpc-configuration/aws-vpc-configuration-spec)
8+
9+
(s/def ::network-configuration-spec (s/keys :opt [::aws-vpc-configuration]))

0 commit comments

Comments
 (0)