Skip to content

Commit

Permalink
removed license and company specific details in assume-role script, c…
Browse files Browse the repository at this point in the history
…onfig.yml and change title of index.html
  • Loading branch information
zephyrz73 committed Aug 27, 2020
1 parent beb7cb7 commit d72950d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 152 deletions.
21 changes: 0 additions & 21 deletions aws-ts-netlify-cms-and-oauth/cms/LICENSE

This file was deleted.

87 changes: 5 additions & 82 deletions aws-ts-netlify-cms-and-oauth/cms/public/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,86 +10,9 @@ backend:

publish_mode: editorial_workflow

# the media_folder's path is relative to this
media_folder: "../../../static/images"
public_folder: "/images"
# Check https://www.netlifycms.org/docs/configuration-options/#media-and-public-folders for setting them
media_folder: "some-media-folder"
public_folder: "some-public-folder"

collections: # A list of collection the CMS should be able to edit
- name: "webinars" # Used in routes, ie.: /collections/webinars
label: "Webinars Pages" # Used in the UI, ie.: "New Post"
folder: "content/webinars" # The path to the folder where the documents are stored
media_folder: "{{media_folder}}/webinar"
public_folder: "{{public_folder}}/webinar"
path: "{{slug}}/index.md" # The webinar folderis structured as name-of-webinar/index.md
create: true # Allow users to create new documents in this collection
fields: # The fields each document in this collection have
- {label: "Title", name: "title", widget: string}
- {label: "Webinar Description", name: "meta_desc", widget: text}
- {label: "Featured Webinar?", name: "featured", widget: boolean, default: false, hint: "A featured webinar will display first in the list."}
- {label: "Pre-Recorded?", name: "pre_recorded", widget: boolean, default: false, hint: "If the video is pre-recorded or live."}
- {label: "Pulumi TV?", name: "pulumi_tv", widget: boolean, default: false, hint: "If the video is part of the PulumiTV series. Setting this value to true will list the video in the 'PulumiTV' section."}
- {label: "Preview Image", name: "preview_image", widget: image, hint: "The preview image will be shown on the list page."}
- {label: "Unlisted", name: "unlisted", widget: boolean, hint: "Webinars with unlisted as true will not be shown on the webinar list"}
- {label: "Gated?", name: "gated", widget: boolean, default: false, hint: "Gated webinars will have a registration form and the user will need to fill out the form before viewing."}
- {label: "Layout Type", name: "type", widget: string, hint: "The layout of the landing page."}
- {label: "External Webinars?", name: "external", widget: boolean, hint: "External webinars will link to an external page instead of a webinar landing/registration page."}
- {label: "URL Slug", name: "url_slug", widget: string, hint: "The url slug for the webinar landing page. If this is an external webinar, use the external URL as the value here."}
- label: "Hero"
name: "hero"
widget: "object"
hint: "The content of the hero section."
fields:
- {label: "Hero Title", name: "title", widget: string, hint: "The title text in the hero. This also serves as the pages header."}
- {label: "Hero Image", name: "image", widget: image, hint: "The image the appears on the right hand side of the hero."}
- label: "Main"
name: "main"
widget: object
hint: "Content for the left hand side section of the page."
fields:
- {label: "Main Title", name: "title", widget: string, hint: "Webinar Title"}
- {label: "Sortable Date", name: "sortable_date", widget: datetime, dateFormat: true, timeFormat: "HH:mm Z", format: "YYYY-MM-DDTHH:mm:00.000Z", pickerUtc: false, hint: "Sortable date. The datetime Hugo will use to sort the webinars in date order."}
- {label: "Duration", name: "duration", widget: string, hint: "Duration of the webinar."}
- {label: "Date Time", name: "datetime", widget: datetime, dateFormat: true, timeFormat: true, format: "ddd MMM DD, YYYY [AT] hh:mmA [PT]", hint: "The time is in Pacific Time"}
- {label: "Main Description", name: "description", widget: text, hint: "Description of Webinar"}
- label: "Presenters"
name: "presenters"
widget: list
allow_add: true
summary: "{{fields.name}} - {{fields.role}}"
fields:
- {label: "Presenter Name", name: "name", widget: string}
- {label: "Presenter Role", name: "role", widget: string}
- label: "Learning goals"
name: "learn"
widget: list
allow_add: true
summary: "{{fields.goal}}"
field: {label: "Learning Goal", name: "goal", widget: string}
hint: "A bullet point list containing what the user will learn during the webinar."
- label: "Form"
name: "form"
widget: object
hint: "The right hand side webinar section."
fields:
- {label: "GoToWebinar Key", name: "gotowebinar_key", widget: string, hint: "GoToWebinar webinar key. This key allows us to register people for webinars via the HubSpot form."}
- {label: "HubSpot Form Id", name: "hubspot_form_id", widget: string}
- name: "events" # Used in routes, ie.: /admin/collections/:slug/edit
label: "Events Pages" # Used in the UI, ie.: "New Post"
folder: "content/events" # The path to the folder where the documents are stored
path: "{{slug}}/index.md"
create: true # Allow users to create new documents in this collection
fields: # The fields each document in this collection have
- {label: "Title", name: "title", widget: string}
- {label: "Unlisted?", name: "unlisted", widget: boolean, hint: "Events with unlisted as true will not be shown on the event list"}
- {label: "Block External Search Index?", name: "block_external_search_index", widget: boolean, hint: "Events with external registrations should not be indexed and have redirect to the external registration page."}
- {label: "Redirect Link", name: "redirect_to", widget: string}
- label: "Event Infomation"
name: "event"
widget: object
fields:
- {label: "Activity Type", name: "type", widget: list, allow_add: true, hint: "The type of activities we will be doing at the event."}
- {label: "Location", name: "location", widget: string, hint: "The event address"}
- {label: "Start Date", name: "start_date", widget: date, format: "YYYY-MM-DD"}
- {label: "End Date", name: "end_date", widget: date, format: "YYYY-MM-DD"}
- {label: "Event Description", name: "description", widget: text, hint: "The event description shown on the event list page."}
- {label: "Registration Link", name: "registration_url", widget: string, hint: "The external registration url for the event list page."}
# Check https://www.netlifycms.org/docs/configuration-options/#configuration-file for configure your CMS
collections:
2 changes: 1 addition & 1 deletion aws-ts-netlify-cms-and-oauth/cms/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Pulumi Website's CMS</title>
<title>Your CMS Website Title</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
49 changes: 1 addition & 48 deletions aws-ts-netlify-cms-and-oauth/cms/scripts/assume-role.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
#!/bin/bash
#
# Configures the local AWS credentials and adds some useful functions to
# the environment. For use in our CI/CD workflows where we use a common
# set of environments and just provide an access key via environment variable.
#
# USAGE:
# 1. Set the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment
# for the CI/CD workflow. They should be to a low privledged user.
# 2. Source this file. It will create files in the ~/.aws folder and
# unset AWS_ACCESS_KEY_ID.
#
# After that, use the AWS SDK like normal. The default profile will use the
# credentials in the initial environment variable. But you can easily change
# AWS accounts by setting the AWS_PROFILE environment variable. (You will set
# AWS_PROFILE="pulumi-ci" in most cases.)
#
# This script also exports two functions: assume_iam_role and unassume_iam_role
# This script exports two functions: assume_iam_role and unassume_iam_role
# which can be used to assume an IAM role without using AWS_PROFILE.

# Function to use the current AWS credentials to assume an IAM Role.
Expand Down Expand Up @@ -66,35 +51,3 @@ if [ ! -z ${AWS_SECURITY_TOKEN} ]; then
echo "ERROR: AWS_SECURITY_TOKEN is set. Something is not right. (In an assumed role?)"
fi

# Write the AWS access key found in an environment variable to disk, allowing for
# transparent IAM role assumption via the AWS SDK.
function write_aws_config_files() {
mkdir -p ${HOME}/.aws/

cat <<EOF >> ${HOME}/.aws/credentials
[default]
aws_access_key_id = ${AWS_ACCESS_KEY_ID}
aws_secret_access_key = ${AWS_SECRET_ACCESS_KEY}
EOF

cat <<EOF >> ${HOME}/.aws/config
[default]
region = us-west-2
[profile pulumi-ci]
role_arn = arn:aws:iam::894850187425:role/ContinuousDeliveryAdminRole
source_profile = default
EOF

# Unset AWS_ACCESS_* so that we don't get confused later when we use AWS_PROFILE.
echo "Unsetting AWS environment variables to rely on the credentials files."
unset {AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY}
}

if [ -f "${HOME}/.aws/config" -o -f "${HOME}/.aws/credentials" ]; then
echo "ERROR: ~/.aws/config or ~/.aws/credentials exist. Not overwriting."
else
echo "Writing ~/.aws/config and ~/.aws/credentials"
write_aws_config_files
fi

echo "Current user: $(aws sts get-caller-identity | jq '.Arn')"

0 comments on commit d72950d

Please sign in to comment.