https://pulumi.com logo
#general
Title
# general
c

cool-egg-852

10/22/2019, 8:33 PM
Copy code
const serviceAccount = new gcp.serviceAccount.Account(config.project, {
  accountId: config.project,
  displayName: config.project
});

const key = new gcp.serviceAccount.Key(config.project, {
  publicKeyType: 'TYPE_X509_PEM_FILE',
  serviceAccountId: serviceAccount.name
});

const gcpCredentials = new k8s.core.v1.Secret('gcp-credentials', {
  metadata: {
    namespace: namespace.metadata.name,
    labels: config.appLabels
  },
  type: 'Opaque',
  stringData: {
    'gcp-credentials.json': key.privateKey.apply(x => Buffer.from(x, 'base64').toString('utf8'))
  }
});