Exhibit 10.2

Execution Copy

FIRST AMENDMENT TO CREDIT AGREEMENT

THIS FIRST AMENDMENT TO CREDIT AGREEMENT (this “Amendment”) dated as of the 27th
day of June, 2012, is by and among PLAINS ALL AMERICAN PIPELINE, L.P. (the
“Company”), PLAINS MIDSTREAM CANADA ULC, a British Columbia unlimited liability
company (formerly an Alberta unlimited liability corporation) (“PMCULC”, and,
together with the Company, the “Borrowers” and individually, a “Borrower”), BANK
OF AMERICA, N.A., as Administrative Agent, Swing Line Lender and an L/C Issuer,
WELLS FARGO BANK, NATIONAL ASSOCIATION, as an L/C Issuer, and the Lenders party
hereto.

W I T N E S S E T H:

WHEREAS, the Company, certain Subsidiaries of the Company from time to time
party thereto, Administrative Agent, Swing Line Lender, certain of the L/C
Issuers and Lenders entered into that certain Credit Agreement dated as of
August 19, 2011 (the “Original Agreement”) for the purposes and consideration
therein expressed; and

WHEREAS, the Borrowers, Administrative Agent, Swing Line Lender, L/C Issuers and
the Lenders party hereto desire to amend the Original Agreement for the purposes
described herein;

NOW, THEREFORE, in consideration of the premises and the mutual covenants and
agreements contained herein and in the Original Agreement, and for other good
and valuable consideration, the receipt and sufficiency of which are hereby
acknowledged, the parties hereto do hereby agree as follows:

ARTICLE I. — Definitions and References

§ 1.1. Terms Defined in the Original Agreement. Unless the context otherwise
requires or unless otherwise expressly defined herein, the terms defined in the
Original Agreement shall have the same meanings whenever used in this Amendment.

§ 1.2. Other Defined Terms. Unless the context otherwise requires, the following
terms when used in this Amendment shall have the meanings assigned to them in
this § 1.2.

“Amendment” means this First Amendment to Credit Agreement.

“Credit Agreement” means the Original Agreement as amended hereby.

ARTICLE II. — Amendments

§ 2.1. Definitions.

(a) The definition of “Applicable Time” set forth in Section 1.01 of the
Original Agreement is hereby amended in part by adding the following at the end
thereof:

; provided, that such local time shall be no earlier than 12:00 noon, Eastern
time.

(b) The definition of “Base Rate” set forth in Section 1.01 of the Original
Agreement is hereby amended in its entirety to read as follows:

--------------------------------------------------------------------------------

“Base Rate” means for any day a fluctuating rate per annum equal to the highest
of (a) the Federal Funds Rate in effect on such day plus 1/2 of 1%, (b) the rate
of interest in effect for such day as publicly announced from time to time by
Bank of America as its “prime rate,” (or, as to Base Rate Loans to a Designated
Borrower, the rate of interest publicly announced from time to time by Bank of
America, Canada Branch as its reference rate of interest for loans in U.S.
Dollars to Canadian customers and designated as its “prime rate”) and (c) the
Eurocurrency Rate in effect on such day as determined pursuant to clause (b) of
the definition thereof plus 1.00%. The “prime rate” is a rate set by Bank of
America (or Bank of America, Canada Branch, as applicable) based upon various
factors including Bank of America’s (or Bank of America, Canada Branch’s, as
applicable) costs and desired return, general economic conditions and other
factors, and is used as a reference point for pricing some loans, which may be
priced at, above, or below such announced rate. Any change in such prime rate
announced by Bank of America (or Bank of America, Canada Branch, as applicable)
shall take effect at the opening of business on the day specified in the public
announcement of such change.

(c) Clause (b) of the definition of “Eurocurrency Rate” set forth in
Section 1.01 of the Original Agreement is hereby amended in its entirety to read
as follows:

(b) for any interest calculation with respect to a Base Rate Loan or a Swing
Line Loan based on the Eurocurrency Rate on any date, the rate per annum equal
to (i) BBA LIBOR, at approximately 12:00 p.m., London time on such date for
deposits in the relevant currency being delivered in the London interbank market
for a term of seven days (or if a term of seven days is unavailable then a term
of one month) commencing that day or (ii) if such published rates are not
available at such time for any reason, the rate per annum determined by the
Administrative Agent to be the rate at which deposits in such currency for
delivery on the date of determination in same day funds in the approximate
amount of the Base Rate Loan or Swing Line Loan being made, continued or
converted and with a term equal to one month would be offered by Bank of
America’s London Branch to major banks in the London interbank Eurocurrency
market at their request at the date and time of determination.

(d) The definition of “Letter of Credit” set forth in Section 1.01 of the
Original Agreement is hereby amended in its entirety to read as follows:

“Letter of Credit” means any letter of credit issued hereunder at the request of
any Borrower providing for the payment of cash upon the honoring of a drawing
thereunder and shall include the Existing Letters of Credit. A Letter of Credit
may be a commercial letter of credit or a standby letter of credit; provided
however, that any commercial letter of credit issued hereunder shall provide
solely for cash payment upon presentation of a sight draft, unless otherwise
agreed to by the L/C Issuer issuing such letter of credit.

(e) The definition of “PMCULC” set forth in Section 1.01 of the Original
Agreement is hereby amended in its entirety to read as follows:

“PMCULC” means Plains Midstream Canada ULC, a British Columbia limited liability
company (formerly an Alberta unlimited liability corporation).

 

2

--------------------------------------------------------------------------------

(f) The references to “and purchase” in the second sentence of the definition of
“Applicable Percentage”, “and purchase” in subclause (i) of clause (a) of the
definition of “Commitment”, and “or purchase” in the definition of “Committed
Borrowing”, each as set forth in Section 1.01 of the Original Agreement, are
hereby deleted.

§ 2.2. Canadian BA’s. The references to “and purchase” in the first sentence of
Section 2.01 of the Original Agreement, and “and purchased” in clause (x) of the
proviso to Section 2.03(a)(i)(B) of the Original Agreement and clause (ii) of
the proviso to Section 2.04(a) of the Original Agreement are hereby deleted, and
the reference to “which term(s) shall be identical” in the first sentence of
Section 4(a) of Schedule 2.01A to the Original Agreement is hereby amended to
refer instead to “which term(s) shall, subject to the provisions hereof, be
identical”.

§ 2.3. Indebtedness. The reference to “Plains Marketing (and guarantees thereof
by its Subsidiaries)” in clause (i) of Section 7.02(d) of the Original Agreement
is hereby amended to refer instead to “Plains Marketing (and guarantees thereof
by its Subsidiaries) and PMCULC (and guarantees thereof by its Subsidiaries)”.

ARTICLE III. — Conditions of Effectiveness

§ 3.1. Effective Date. This Amendment shall become effective as of the date
first written above, when and only when

(i) Administrative Agent shall have received, at Administrative Agent’s office a
counterpart of this Amendment executed and delivered by each Borrower,
Administrative Agent, each L/C Issuer and Required Lenders; and

(ii) Administrative Agent shall have additionally received all of the following
documents, each document (unless otherwise indicated) being dated the date of
receipt thereof by Administrative Agent, duly authorized, executed and
delivered, and in form and substance reasonably satisfactory to Administrative
Agent:

Supporting Documents. Such supporting documents as Administrative Agent may
reasonably request.

ARTICLE IV. — Representations and Warranties

§ 4.1. Representations and Warranties of the Company. In order to induce
Administrative Agent, L/C Issuers and Lenders to enter into this Amendment, the
Company represents and warrants to Administrative Agent, L/C Issuers and each
Lender that:

(a) The representations and warranties of (i) the Company contained in Article V
of the Credit Agreement and (ii) each Loan Party in any other Loan Document are
true and correct in all material respects on and as of the date hereof, except
to the extent that such representations and warranties specifically refer to an
earlier date, in which case they shall be true and correct in all material
respects as of such earlier date, and except that the representations and
warranties contained in subsections (a) and (b) of Section 5.05 of the Credit
Agreement shall be deemed to refer to the most recent statements furnished
pursuant to clauses (a) and (b), respectively, of Section 6.01 of the Credit
Agreement.

 

3

--------------------------------------------------------------------------------

(b) No Default has occurred and is continuing.

ARTICLE V. — Miscellaneous

§ 5.1. Ratification of Agreements. The Original Agreement, as hereby amended, is
hereby ratified and confirmed in all respects. The Loan Documents, as they may
be amended or affected by this Amendment, are hereby ratified and confirmed in
all respects by each Borrower. Any reference to the Original Agreement in any
Loan Document shall be deemed to refer to the Credit Agreement. The execution,
delivery and effectiveness of this Amendment shall not, except as expressly
provided herein, operate as a waiver of any right, power or remedy of
Administrative Agent, any L/C Issuer or any Lender under the Credit Agreement or
any other Loan Document nor constitute a waiver of any provision of the Credit
Agreement or any other Loan Document.

§ 5.2. Loan Documents. This Amendment is a Loan Document, and all provisions in
the Credit Agreement pertaining to Loan Documents apply hereto.

§ 5.3. GOVERNING LAW. THIS AMENDMENT SHALL BE GOVERNED BY, AND CONSTRUED IN
ACCORDANCE WITH, THE LAWS OF THE STATE OF NEW YORK, WITHOUT REGARD TO PRINCIPLES
OF CONFLICTS OF LAW.

§ 5.4. Counterparts. This Amendment may be executed in counterparts (and by
different parties hereto in different counterparts), each of which shall
constitute an original, but all of which when taken together shall constitute a
single contract. Delivery of an executed counterpart of a signature page of this
Amendment by telecopy or other electronic imaging means shall be effective as
delivery of a manually executed counterpart of this Amendment.

§ 5.5. ENTIRE AGREEMENT. THIS AMENDMENT AND THE OTHER LOAN DOCUMENTS REPRESENT
THE FINAL AGREEMENT AMONG THE PARTIES AND MAY NOT BE CONTRADICTED BY EVIDENCE OF
PRIOR, CONTEMPORANEOUS, OR SUBSEQUENT ORAL AGREEMENTS OF THE PARTIES. THERE ARE
NO UNWRITTEN ORAL AGREEMENTS AMONG THE PARTIES.

[Remainder of page intentionally left blank]

 

4

--------------------------------------------------------------------------------

IN WITNESS WHEREOF, this Amendment is executed as of the date first above
written.

 

PLAINS ALL AMERICAN PIPELINE, L.P. By:   PAA GP LLC, its general partner By:  
PLAINS AAP, L.P., its sole member By:   PLAINS ALL AMERICAN GP LLC,   its
general partner By:   /s/ Charles Kingswell-Smith   Charles Kingswell-Smith  
Vice President and Treasurer

 

PLAINS MIDSTREAM CANADA ULC By:   /s/ Charles Kingswell-Smith   Charles
Kingswell-Smith   Vice President and Treasurer

 

BANK OF AMERICA, N.A., as Administrative Agent By:   /s/ Bridgett J. Manduk
Name:   Bridgett J. Manduk Title:   Assistant Vice President

 

BANK OF AMERICA, N.A., as a Lender, L/C Issuer and Swing Line Lender By:   /s/
Adam H. Fey Name:   Adam H. Fey Title:   Director

 

 

PAA First Amendment

 

S-1

--------------------------------------------------------------------------------

WELLS FARGO BANK, NATIONAL

ASSOCIATION, as a Lender and L/C Issuer

By:   /s/ Mark Oberreuter Name:   Mark Oberreuter Title:   Vice President

 

DNB BANK ASA, GRAND CAYMAN

BRANCH, as a Lender

By:   /s/ Henrik Asland Name:   Henrik Asland Title:   Senior Vice President

 

By:   /s/ Pål Boger Name:   Pål Boger Title:   Vice President

 

JPMORGAN CHASE BANK, N.A., as a Lender By:   /s/ Kenneth J. Fatur Name:  
Kenneth J. Fatur Title:   Managing Director

 

SUNTRUST BANK, as a Lender By:   /s/ Andrew Johnson Name:   Andrew Johnson
Title:   Director

 

SOCIETE GENERALE, as a Lender By:   /s/ Chad Clark Name:   Chad Clark Title:  
Managing Director

 

PAA First Amendment

 

S-2

--------------------------------------------------------------------------------

BARCLAYS BANK PLC, as a Lender By:   /s/ Michael J. Mozer Name:   Michael J.
Mozer Title:   Vice President

 

CITIBANK, N.A., as a Lender By:   /s/ John F. Miller Name:   John F. Miller
Title:   Attorney-in-Fact

 

MIZUHO CORPORATE BANK, LTD., as a Lender By:   /s/ Leon Mo Name:   Leon Mo
Title:   Authorized Signatory

 

UBS LOAN FINANCE LLC, as a Lender By:   /s/ Irja R. Otsa              /s/ Mary
E. Evans Name:   Irja R. Otsa                    Mary E. Evans Title:   Assoc.
Director            Assoc. Director

 

THE BANK OF NOVA SCOTIA, as a Lender By:   /s/ Mark Sparrow Name:   Mark Sparrow
Title:   Director

 

ROYAL BANK OF CANADA, as a Lender By:   /s/ Kristan Spivey Name:   Kristan
Spivey Title:   Authorized Signatory

 

PAA First Amendment

 

S-3

--------------------------------------------------------------------------------

U.S. BANK NATIONAL ASSOCIATION, as a Lender By:   /s/ Justin Alexander Name:  
Justin Alexander Title:   Vice President By:   /s/ Joseph Rauhala Name:   Joseph
Rauhala Title:   Principal Officer THE BANK OF TOKYO-MITSUBISHI UFJ, LTD., as a
Lender By:   /s/ Andrew Oram Name:   Andrew Oram Title:   Managing Director
SUMITOMO MITSUI BANKING CORPORATION, as a Lender By:   /s/ Shuji Yabe Name:  
Shuji Yabe Title:   Managing Director ING CAPITAL LLC, as a Lender By:   /s/
Cheryl Labelle Name:   Cheryl Labelle Title:   Managing Director

PNC BANK NATIONAL ASSOCIATION,

as a Lender

By:   /s/ John Berry Name:   John Berry Title:   Vice President

 

PAA First Amendment

 

S-4

--------------------------------------------------------------------------------

COMPASS BANK, as a Lender By:   /s/ Dorothy Marchand Name:   Dorothy Marchand
Title:   Senior Vice President FIFTH THIRD BANK, as a Lender By:   /s/ Matthew
Lewis Name:   Matthew Lewis Title:   Vice President REGIONS BANK, as a Lender
By:   /s/ David Valentine Name:   David Valentine Title:   Vice President BANK
OF MONTREAL, as a Lender By:   /s/ Gumaro Tijerina Name:   Gumaro Tijerina
Title:   Director AMEGY BANK NATIONAL ASSOCIATION, as a Lender By:   /s/ H.
Brock Hudson Name:   H. Brock Hudson Title:   Senior Vice President COMERICA
BANK, as a Lender By:   /s/ Justin Crawford Name:   Justin Crawford Title:  
Vice President

 

PAA First Amendment

 

S-5

--------------------------------------------------------------------------------

RAYMOND JAMES BANK, N.A., as a Lender By:   /s/ Scott G. Axelrod Name:   Scott
G. Axelrod Title:   Vice President

 

PAA First Amendment

 

S-6