Skip to content

Commit

Permalink
Merge pull request pulumi#968 from pulumi/vl/TSLint
Browse files Browse the repository at this point in the history
Make recommended update to tslint.json to avoid deprecation warning
  • Loading branch information
Vivek Lakshmanan authored Apr 16, 2021
2 parents 258d3ba + 76327de commit 113ef71
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 39 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ jobs:
- name: Install + Configure Helm
run: |-
curl -o- -L https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
helm init -c
helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Configure GCP credentials
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
Expand Down Expand Up @@ -223,7 +222,6 @@ jobs:
- name: Install + Configure Helm
run: |-
curl -o- -L https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
helm init -c
helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Configure GCP credentials
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
Expand Down Expand Up @@ -373,7 +371,6 @@ jobs:
- name: Install + Configure Helm
run: |-
curl -o- -L https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
helm init -c
helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Configure GCP credentials
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
Expand Down Expand Up @@ -455,7 +452,6 @@ jobs:
- name: Install + Configure Helm
run: |-
curl -o- -L https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
helm init -c
helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Configure GCP credentials
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/run-tests-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ jobs:
- name: Install + Configure Helm
run: |-
curl -o- -L https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
helm init -c
helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Configure GCP credentials
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
Expand Down Expand Up @@ -253,7 +252,6 @@ jobs:
- name: Install + Configure Helm
run: |-
curl -o- -L https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
helm init -c
helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Configure GCP credentials
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
Expand Down Expand Up @@ -387,7 +385,6 @@ jobs:
- name: Install + Configure Helm
run: |-
curl -o- -L https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
helm init -c
helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Configure GCP credentials
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
Expand Down Expand Up @@ -471,7 +468,6 @@ jobs:
- name: Install + Configure Helm
run: |-
curl -o- -L https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
helm init -c
helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Configure GCP credentials
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/smoke-test-cli-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ jobs:
- name: Install + Configure Helm
run: |-
curl -o- -L https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
helm init -c
helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Configure GCP credentials
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
Expand Down Expand Up @@ -196,7 +195,6 @@ jobs:
- name: Install + Configure Helm
run: |-
curl -o- -L https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
helm init -c
helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Configure GCP credentials
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
Expand Down Expand Up @@ -328,7 +326,6 @@ jobs:
- name: Install + Configure Helm
run: |-
curl -o- -L https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
helm init -c
helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Configure GCP credentials
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
Expand Down Expand Up @@ -410,7 +407,6 @@ jobs:
- name: Install + Configure Helm
run: |-
curl -o- -L https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
helm init -c
helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Configure GCP credentials
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/smoke-test-provider-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ jobs:
- name: Install + Configure Helm
run: |-
curl -o- -L https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
helm init -c
helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Configure GCP credentials
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
Expand Down Expand Up @@ -196,7 +195,6 @@ jobs:
- name: Install + Configure Helm
run: |-
curl -o- -L https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
helm init -c
helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Configure GCP credentials
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
Expand Down Expand Up @@ -320,7 +318,6 @@ jobs:
- name: Install + Configure Helm
run: |-
curl -o- -L https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
helm init -c
helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Configure GCP credentials
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
Expand Down Expand Up @@ -402,7 +399,6 @@ jobs:
- name: Install + Configure Helm
run: |-
curl -o- -L https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
helm init -c
helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Configure GCP credentials
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
Expand Down
40 changes: 20 additions & 20 deletions aws-ts-static-website/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import * as aws from "@pulumi/aws";
import * as pulumi from "@pulumi/pulumi";

import * as fs from "fs";
import * as mime from "mime";
import * as path from "path";


// Load the Pulumi program configuration. These act as the "parameters" to the Pulumi program,
// so that different Pulumi Stacks can be brought up using the same code.

Expand All @@ -19,10 +19,10 @@ const config = {
targetDomain: stackConfig.require("targetDomain"),
// (Optional) ACM certificate ARN for the target domain; must be in the us-east-1 region. If omitted, an ACM certificate will be created.
certificateArn: stackConfig.get("certificateArn"),
// If true create an A record for the www subdomain of targetDomain pointing to the generated cloudfront distribution.
// If true create an A record for the www subdomain of targetDomain pointing to the generated cloudfront distribution.
// If a certificate was generated it will support this subdomain.
// default: true
includeWWW: stackConfig.getBoolean("includeWWW") || true
// default: true
includeWWW: stackConfig.getBoolean("includeWWW") || true,
};

// contentBucket is the S3 bucket that the website's contents will be stored in.
Expand Down Expand Up @@ -98,11 +98,11 @@ if (config.certificateArn === undefined) {
});

// if config.includeWWW include required subjectAlternativeNames to support the www subdomain
let certificateConfig:aws.acm.CertificateArgs = {
const certificateConfig: aws.acm.CertificateArgs = {
domainName: config.targetDomain,
validationMethod: "DNS",
subjectAlternativeNames: config.includeWWW ? [`www.${config.targetDomain}`]: []
}
validationMethod: "DNS",
subjectAlternativeNames: config.includeWWW ? [`www.${config.targetDomain}`] : [],
};

const certificate = new aws.acm.Certificate("certificate", certificateConfig, { provider: eastRegion });

Expand All @@ -122,7 +122,7 @@ if (config.certificateArn === undefined) {
});

// if config.includeWWW ensure we validate the www subdomain as well
var subdomainCertificateValidationDomain;
let subdomainCertificateValidationDomain;
if (config.includeWWW) {
subdomainCertificateValidationDomain = new aws.route53.Record(`${config.targetDomain}-validation2`, {
name: certificate.domainValidationOptions[1].resourceRecordName,
Expand All @@ -134,8 +134,8 @@ if (config.certificateArn === undefined) {
}

// if config.includeWWW include the validation record for the www subdomain
const validationRecordFqdns = subdomainCertificateValidationDomain === undefined ?
[certificateValidationDomain.fqdn] : [certificateValidationDomain.fqdn, subdomainCertificateValidationDomain.fqdn]
const validationRecordFqdns = subdomainCertificateValidationDomain === undefined ?
[certificateValidationDomain.fqdn] : [certificateValidationDomain.fqdn, subdomainCertificateValidationDomain.fqdn];

/**
* This is a _special_ resource that waits for ACM to complete validation via the DNS record
Expand All @@ -155,7 +155,7 @@ if (config.certificateArn === undefined) {
}

// if config.includeWWW include an alias for the www subdomain
const distributionAliases = config.includeWWW ? [config.targetDomain, `www.${config.targetDomain}`]:[config.targetDomain]
const distributionAliases = config.includeWWW ? [config.targetDomain, `www.${config.targetDomain}`] : [config.targetDomain];

// distributionArgs configures the CloudFront distribution. Relevant documentation:
// https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html
Expand Down Expand Up @@ -279,11 +279,11 @@ function createWWWAliasRecord(targetDomain: string, distribution: aws.cloudfront
const domainParts = getDomainAndSubdomain(targetDomain);
const hostedZoneId = aws.route53.getZone({ name: domainParts.parentDomain }, { async: true }).then(zone => zone.zoneId);

return new aws.route53.Record(
`${targetDomain}-www-alias`,
return new aws.route53.Record(
`${targetDomain}-www-alias`,
{
name: `www.${targetDomain}`,
zoneId: hostedZoneId,
name: `www.${targetDomain}`,
zoneId: hostedZoneId,
type: "A",
aliases: [
{
Expand All @@ -292,18 +292,18 @@ function createWWWAliasRecord(targetDomain: string, distribution: aws.cloudfront
evaluateTargetHealth: true,
},
],
}
)
},
);
}

const aRecord = createAliasRecord(config.targetDomain, cdn);
if (config.includeWWW){
if (config.includeWWW) {
const cnameRecord = createWWWAliasRecord(config.targetDomain, cdn);
}

// Export properties from this stack. This prints them at the end of `pulumi up` and
// makes them easier to access from the pulumi.com.
export const contentBucketUri = pulumi.interpolate `s3://${contentBucket.bucket}`;
export const contentBucketUri = pulumi.interpolate`s3://${contentBucket.bucket}`;
export const contentBucketWebsiteEndpoint = contentBucket.websiteEndpoint;
export const cloudFrontDomain = cdn.domainName;
export const targetDomainEndpoint = `https://${config.targetDomain}/`;
49 changes: 46 additions & 3 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,52 @@
"label-position": true,
"member-access": false,
"member-ordering": [
true,
"static-before-instance",
"variables-before-functions"
true,
{
"order": [
{
"name": "static field",
"kinds": [
"public-static-field",
"protected-static-field",
"private-static-field"
]
},
{
"name": "instance field",
"kinds": [
"public-instance-field",
"protected-instance-field",
"private-instance-field"
]
},
{
"name": "static method",
"kinds": [
"public-static-method",
"private-static-method",
"protected-static-method",
"public-static-accessor",
"protected-static-accessor",
"private-static-accessor"
]
},
{
"name": "instance method",
"kinds": [
"public-constructor",
"protected-constructor",
"private-constructor",
"public-instance-method",
"protected-instance-method",
"private-instance-method",
"public-instance-accessor",
"protected-instance-accessor",
"private-instance-accessor"
]
}
]
}
],
"no-any": false,
"no-arg": true,
Expand Down

0 comments on commit 113ef71

Please sign in to comment.