Skip to content

Commit

Permalink
Merge remote-tracking branch 'github/pull/622'
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Sep 23, 2023
2 parents acb5ea4 + a6ac3a7 commit 43ff2cf
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test-kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ jobs:
- php-apache
- php-fpm
- planet
- planet-aws
- planet-current
- planet-dump
- planet-notes
Expand Down
3 changes: 3 additions & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ suites:
- name: planet
run_list:
- recipe[planet::default]
- name: planet-aws
run_list:
- recipe[planet::aws]
- name: planet-current
run_list:
- recipe[planet::current]
Expand Down
44 changes: 44 additions & 0 deletions cookbooks/planet/recipes/aws.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#
# Cookbook:: planet
# Recipe:: aws
#
# Copyright:: 2023, OpenStreetMap Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

include_recipe "accounts"
include_recipe "awscli"

aws_credentials = data_bag_item("planet", "aws")

directory "/home/planet/.aws" do
owner "planet"
group "planet"
mode "0755"
end

template "/home/planet/.aws/config" do
source "aws-config.erb"
owner "planet"
group "planet"
mode "0644"
end

template "/home/planet/.aws/credentials" do
source "aws-credentials.erb"
owner "planet"
group "planet"
mode "0600"
variables :credentials => aws_credentials
end
2 changes: 1 addition & 1 deletion cookbooks/planet/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

include_recipe "accounts"
include_recipe "apache"
include_recipe "awscli"
include_recipe "planet::aws"
include_recipe "munin"

package %w[
Expand Down
2 changes: 1 addition & 1 deletion cookbooks/planet/recipes/notes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#

include_recipe "accounts"
include_recipe "awscli"
include_recipe "git"
include_recipe "planet::aws"

db_passwords = data_bag_item("db", "passwords")

Expand Down
2 changes: 1 addition & 1 deletion cookbooks/planet/recipes/replication.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
include_recipe "accounts"
include_recipe "apt"
include_recipe "osmosis"
include_recipe "planet::aws"
include_recipe "ruby"
include_recipe "tools"
include_recipe "awscli"

db_passwords = data_bag_item("db", "passwords")

Expand Down
8 changes: 8 additions & 0 deletions cookbooks/planet/templates/default/aws-config.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[profile osm-pds]
region = eu-central-1

[profile osm-pds-upload]
region = eu-central-1
s3 =
max_bandwidth = 75MB/s
max_concurrent_requests = 512
7 changes: 7 additions & 0 deletions cookbooks/planet/templates/default/aws-credentials.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[osm-pds]
aws_access_key_id = AKIAZFVRMSDZE2DANIFS
aws_secret_access_key = <%= @credentials["osm-pds"] %>

[osm-pds-upload]
role_arn=arn:aws:iam::630658470130:role/osm-pds-upload-role
source_profile=osm-pds
4 changes: 4 additions & 0 deletions test/data_bags/planet/aws.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"id": "aws",
"osm-pds": "osm-pds"
}

0 comments on commit 43ff2cf

Please sign in to comment.