Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement]: AWS AppFlow for Microsoft SharePoint #35779

Open
CalebKinsella opened this issue Feb 12, 2024 · 8 comments
Open

[Enhancement]: AWS AppFlow for Microsoft SharePoint #35779

CalebKinsella opened this issue Feb 12, 2024 · 8 comments
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/appflow Issues and PRs that pertain to the appflow service.

Comments

@CalebKinsella
Copy link

CalebKinsella commented Feb 12, 2024

Description

The current Terraform AWS AppFlow doesn't support Microsoft SharePoint as a source location.

Affected Resource(s) and/or Data Source(s)

resource "aws_appflow_flow" "example" {
  name = "example"

  source_flow_config {
    connector_type = "S3"  ---Current valid examples are Salesforce, Slack, S3 etc . . . ideally would love to see an update where this support SharePoint.
    source_connector_properties {
      .
      .
      .
      .
      }
    }
  }

Potential Terraform Configuration

resource "aws_appflow_flow" "example" {
  name = "example"
  source_flow_config {
    connector_type = "SharePoint"
    source_connector_properties {
      sharepoint {
       sharpeoint_connection_name = aws_appflow_connection_name.name
        tenant_id = "azure_tenant_id" 
      }
    }
  }

References

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/appflow_flow#custom-connector-source-properties

Would you like to implement a fix?

No

@CalebKinsella CalebKinsella added the enhancement Requests to existing resources that expand the functionality or scope. label Feb 12, 2024
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/appflow Issues and PRs that pertain to the appflow service. label Feb 12, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Feb 12, 2024
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Feb 13, 2024
@tomaszdudek7
Copy link

Would be great to have. Any plans?

@NicholasFiorentini
Copy link

Is it possible to Terraform an AWS AppFlow SharePoint automation using the CustomConnector while waiting for this to be implemented?

@NicholasFiorentini
Copy link

NicholasFiorentini commented Sep 25, 2024

Is it possible to Terraform an AWS AppFlow SharePoint automation using the CustomConnector while waiting for this to be implemented?

Yes, but it is not straightforward.
You still need to create the connection and the flow from UI, then import it to Terraform:

locals {
  azure_sharepoint_tenant_id = "<tenant-id>"
  sharepoint_entity = "<copy from import after UI config>"
  sharepoint_subentity = "<copy from import after UI config>"
}

resource "aws_appflow_connector_profile" "sharepoint" {
  name            = "Sharepoint"
  connector_type  = "CustomConnector"
  connection_mode = "Public"
  connector_label = "MicrosoftSharePointOnline"

  connector_profile_config {
    connector_profile_credentials {}
    connector_profile_properties {
      custom_connector {
        oauth2_properties {
          oauth2_grant_type = "AUTHORIZATION_CODE"
          token_url         = "https://login.microsoftonline.com/${local.azure_sharepoint_tenant_id}/oauth2/v2.0/token"
        }
      }
    }
  }
}

resource "aws_appflow_flow" "flow" {
  name        = "FlowName"
  description = "Flow description"

  source_flow_config {
    connector_type         = "CustomConnector"
    connector_profile_name = "Sharepoint"
    api_version            = "v1.0"
    incremental_pull_config {
      datetime_type_field_name = "lastModifiedDateTime"
    }

    source_connector_properties {
      custom_connector {
        entity_name = local.sharepoint_entity
        custom_properties = {
          subEntities = jsonencode([local.sharepoint_subentity])
        }
      }
    }
  }

  destination_flow_config {
    connector_type = "S3"
    destination_connector_properties {
      s3 {
        bucket_name   = "bucket-name"
        bucket_prefix = "prefix"
        # full path will be s3://bucket-name/prefix/flowName/

        s3_output_format_config {
          file_type = "JSON"
        }
      }
    }
  }

  task {
    source_fields     = ["name"]
    destination_field = "name"
    task_type         = "Map"

    task_properties = {
      "DESTINATION_DATA_TYPE" = "String"
      "SOURCE_DATA_TYPE"      = "String"
    }

    connector_operator {
      custom_connector = "NO_OP"
    }
  }

  task {
    destination_field = ""
    source_fields     = ["name"]
    task_type         = "Filter"

    task_properties = {}

    connector_operator {
      custom_connector = "PROJECTION"
    }
  }

  trigger_config {
    // your config
  }
}

@tomaszdudek7
Copy link

@NicholasFiorentini - do you know if the connection itself can be created programatically via AWS API, or is it something that is Console only?

@NicholasFiorentini
Copy link

@NicholasFiorentini - do you know if the connection itself can be created programatically via AWS API, or is it something that is Console only?

No idea I didn't try with API or cli.

@NicholasFiorentini
Copy link

NicholasFiorentini commented Sep 25, 2024

Actually, you cannot import the connector due to:

Error: updating AppFlow Connector Profile (arn:aws:appflow:***:connectorprofile/***): 
operation error Appflow: UpdateConnectorProfile, https response error StatusCode: 400, 
RequestID: ***, ValidationException: connectorProfileConfig: properties/credentials is null for 
ConnectorType: CUSTOMCONNECTOR

@NicholasFiorentini
Copy link

Actually, you cannot import the connector due to:

Error: updating AppFlow Connector Profile (arn:aws:appflow:***:connectorprofile/***): 
operation error Appflow: UpdateConnectorProfile, https response error StatusCode: 400, 
RequestID: ***, ValidationException: connectorProfileConfig: properties/credentials is null for 
ConnectorType: CUSTOMCONNECTOR

Nevermind, if you replan this no longer appears and everything looks fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/appflow Issues and PRs that pertain to the appflow service.
Projects
None yet
Development

No branches or pull requests

4 participants