title: AWS Cloudformation / Codepipeline Parameters: [ProjectId] must have values
body: <p>I am trying to create a simple (for now) cloud formation/code pipeline integration, but I am getting an error when generating a changeset for cloudformation.</p>
  
  <p>I have my code pipeline building the output YML (template below) using the code: <code>- aws cloudformation package --template template.json --s3-bucket $S3_BUCKET --output-template template-export.yml</code> that export then goes into the cloud formation to create a changeset. </p>
  
  <p>When it trys to create the changeset, I get this error <code>Parameters: [ProjectId] must have values (Service: AmazonCloudFormation; Status Code: 400; Error Code: ValidationError; Request ID: 4d20b24f-fd8b-11e8-9014-599dd1a18437)</code></p>
  
  <p>What is going wrong?</p>
  
  <p>Input template.json</p>
  
  <pre><code>{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Parameters": {
      "ProjectId": {
        "Type": "String",
        "Description": "Codepipeline cloudformation test"
      },
      "Stage": {
        "Default": "",
        "Type": "String",
        "Description": "I am guessing some thing goes here"
      }
    },
    "Resources": {
      "LambdaExecutionRole": {
        "Type": "AWS::IAM::Role",
        "Description": "Creating service role in IAM for AWS Lambda",
        "Properties": {
          "RoleName": {
            "Fn::Sub": "CodeStar-${ProjectId}-Execution${Stage}"
          },
          "AssumeRolePolicyDocument": {
            "Statement": [{
              "Action": "sts:AssumeRole",
              "Effect": "Allow",
              "Principal": {
                "Service": [
                  "lambda.amazonaws.com"
                ]
              }
            }]
          },
          "ManagedPolicyArns": [
            "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
          ],
          "Path": "/"
        }
      },
      "CreateUser": {
        "Type": "AWS::Lambda::Function",
        "Properties": {
          "Handler": "API/CreateUser.handler",
          "Code": "API/CreateUser.py",
          "Role": {
            "Fn::GetAtt": [
              "LambdaExecutionRole",
              "Arn"
            ]
          },
          "Runtime": "python2.7",
        }
      }
    }
  
  }
  </code></pre>
  
  <p>Output from codebuild template-export.yml</p>
  
  <pre><code>AWSTemplateFormatVersion: '2010-09-09'
  Parameters:
    ProjectId:
      Description: Codepipeline cloudformation test
      Type: String
    Stage:
      Default: ''
      Description: I am guessing some thing goes here
      Type: String
  Resources:
    CreateUser:
      Properties:
        Code:
          S3Bucket: xxxx
          S3Key: xxxx
        Handler: API/CreateUser.handler
        Role:
          Fn::GetAtt:
          - LambdaExecutionRole
          - Arn
        Runtime: python2.7
      Type: AWS::Lambda::Function
    LambdaExecutionRole:
      Description: Creating service role in IAM for AWS Lambda
      Properties:
        AssumeRolePolicyDocument:
          Statement:
          - Action: sts:AssumeRole
            Effect: Allow
            Principal:
              Service:
              - lambda.amazonaws.com
        ManagedPolicyArns:
        - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
        Path: /
        RoleName:
          Fn::Sub: CodeStar-${ProjectId}-Execution${Stage}
      Type: AWS::IAM::Role
  </code></pre>
  
  <p>Other Info:</p>
  
  <p>Cloudformation is using IAM with full admin privilages. <code>allow *</code></p>
  
  <p>Generate Changeset Settings:</p>
  
  <ul>
  <li>Action Mode: Create or replace a change set</li>
  <li>Template: BuildArtifact::template-export.yml</li>
  <li>Capabilities: CAPABILITY_NAMED_IAM</li>
  <li>Role name: cloudformation-admin</li>
  <li>Input artifacts: BuildArtifact</li>
  </ul>