File tree 5 files changed +129
-0
lines changed
infra/aws/terraform/kops-infra-ci
5 files changed +129
-0
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ Copyright 2023 The Kubernetes Authors.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */
16
+
17
+ data "aws_availability_zones" "available" {
18
+ provider = aws. kops-infra-ci
19
+ state = " available"
20
+ }
21
+
22
+ data "aws_caller_identity" "current" {
23
+ provider = aws. kops-infra-ci
24
+ }
25
+
26
+ data "aws_region" "current" {
27
+ provider = aws. kops-infra-ci
28
+ }
29
+
30
+ data "aws_organizations_organization" "current" {}
Original file line number Diff line number Diff line change
1
+ /*
2
+ Copyright 2023 The Kubernetes Authors.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */
16
+
17
+
18
+ locals {
19
+ kops-infra-ci-name = " kops-infra-ci"
20
+ kops-infra-ci-index = index (data. aws_organizations_organization . current . accounts . * . name , local. kops-infra-ci-name )
21
+ kops-infra-ci-account-id = data. aws_organizations_organization . current . accounts [local . kops-infra-ci-index ]. id
22
+ }
Original file line number Diff line number Diff line change
1
+ /*
2
+ Copyright 2023 The Kubernetes Authors.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */
16
+
17
+ provider "aws" {
18
+ region = " us-east-2"
19
+ alias = " kops-infra-ci"
20
+
21
+ assume_role {
22
+ role_arn = " arn:aws:iam::${ local . kops-infra-ci-account-id } :role/OrganizationAccountAccessRole"
23
+ }
24
+ }
Original file line number Diff line number Diff line change
1
+ /*
2
+ Copyright 2023 The Kubernetes Authors.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */
16
+
17
+ terraform {
18
+ backend "s3" {
19
+ bucket = " k8s-infra-kops-ci-tf-state"
20
+ region = " us-east-2"
21
+ key = " kops-infra-ci/terraform.tfstate"
22
+ // TODO(ameukam): stop used hardcoded account id. Preferably use SSO user
23
+ role_arn = " arn:aws:iam::808842816990:role/OrganizationAccountAccessRole"
24
+ session_name = " kops-infra-ci"
25
+ }
26
+
27
+ required_providers {
28
+ aws = {
29
+ source = " hashicorp/aws"
30
+ version = " ~> 5.11.0"
31
+ }
32
+ }
33
+ }
Original file line number Diff line number Diff line change
1
+ /*
2
+ Copyright 2023 The Kubernetes Authors.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */
16
+
17
+
18
+ terraform {
19
+ required_version = " ~> 1.5.1"
20
+ }
You can’t perform that action at this time.
0 commit comments