title: Terraform aws - Unable to create AWS SFTP server using terraform script
body: <p>I am trying to create <code>AWS SFTP</code> server using <code>terraform</code> script.</p>
  <p>I am able to validate using <code>terraform validate</code> command and able to get plan using <code>terraform plan</code> as well</p>
  <p>but I am getting below error while trying to run <code>terraform apply</code> command</p>
  <blockquote>
  <p>Error: Error creating Transfer Server: InvalidRequestException: Must specify
  IdentityProviderType with IdentityProviderDetails
  on .terraform/modules/sftp/sftp.tf line 1, in resource &quot;aws_transfer_server&quot; &quot;sftp&quot;:
  1: resource &quot;aws_transfer_server&quot; &quot;sftp&quot; {
  <a href="https://i.stack.imgur.com/PqUbq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PqUbq.png" alt="enter image description here" /></a></p>
  </blockquote>
  <p>I have provided the <code>identity_provider_type = &quot;SERVICE_MANAGED&quot;</code> in my script but still i am getting the error and unable to create AWS SFTP server.</p>
  <p>Here is my scripts</p>
  <p><strong>sftp.tf</strong></p>
  <pre><code>provider &quot;aws&quot; {
     version = &quot;~&gt; 2.0&quot;
     region  = &quot;us-east-1&quot;
  }
  
  resource &quot;aws_transfer_server&quot; &quot;sftp&quot; {
    identity_provider_type = &quot;SERVICE_MANAGED&quot;
    invocation_role = &quot;arn:aws:iam::&lt;id&gt;&quot;
  
    tags = {
          NAME     = &quot;test-sftp&quot;
    }
  }
  </code></pre>
  <p><strong>main.tf</strong></p>
  <pre><code>provider &quot;aws&quot; {
      version = &quot;~&gt; 2.0&quot;
      region  = &quot;us-east-1&quot;
  }
  
  module &quot;sftp&quot; {
      source = &quot;/home/sasi/TerraForm/terraform-scripts/modules/sftp&quot;
      aws-transfer-server-name = &quot;test-sftp&quot;
      iam-role-name-for-sftp = &quot;test-sftp-role&quot;
      s3-access-policy-name = &quot;s3-specific-bucket-access&quot;
      sftp-user-name = &quot;sasi-sftp&quot;
      sftp-s3-bucket-name = &quot;/sasi-learn-test-bucket&quot;
      ssh-public-key-file-location = &quot;${file(&quot;/home/sasi/TerraForm/terraform-scripts/modules/sftp/rsa.pub&quot;)}&quot;
  }
  </code></pre>