Skip to content
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.

Commit

Permalink
added change db passwords
Browse files Browse the repository at this point in the history
  • Loading branch information
glassresistor committed Dec 14, 2017
1 parent 71d52c4 commit b65d63a
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions change_db_passwords.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
- include: includes/pre_zappa.yml
- hosts: localhost
connection: local
gather_facts: no
tasks:
- name: Set Environment Variables on Lambda function
command: "aws lambda update-function-configuration --region {{ region }} --function-name intake-{{ environment_name }} --environment '{{ lambda_environment|to_json }}'"
environment:
AWS_ACCESS_KEY_ID: "{{ lookup('env','AWS_ACCESS_KEY_ID') }}"
AWS_SECRET_ACCESS_KEY: "{{ lookup('env','AWS_SECRET_ACCESS_KEY') }}"
PYTHONPATH: "python3.5"

- name: Create Application User with DB access
postgresql_user:
login_host: "{{ database.instance.endpoint }}"
login_user: "{{ pg_username }}"
login_password: "{{ pg_password }}"
db: intake
name: "{{ pg_app_username }}"
password: "{{ pg_app_password }}"


- name: Create Clips User with Privacy Preserving Access
postgresql_user:
login_host: "{{ database.instance.endpoint }}"
login_user: "{{ pg_username }}"
login_password: "{{ pg_password }}"
db: intake
name: "clips"
password: "{{ pg_clips_password }}"

- name: Delete Old Key for S3 User for Application
command: "aws iam delete-access-key --access-key {{ s3_user.user_meta.access_keys[0].access_key_id }} --user-name {{ project_slug }}-s3-user"
environment:
AWS_ACCESS_KEY_ID: "{{ lookup('env','AWS_ACCESS_KEY_ID') }}"
AWS_SECRET_ACCESS_KEY: "{{ lookup('env','AWS_SECRET_ACCESS_KEY') }}"
PYTHONPATH: "python3.5"

0 comments on commit b65d63a

Please sign in to comment.